Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
57ac5f01
Unverified
Commit
57ac5f01
authored
Nov 19, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for 32bit, version bump
parent
d5a71b0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
CMakeLists.txt
+1
-1
changelog
+3
-0
include/cif++/item.hpp
+6
-5
No files found.
CMakeLists.txt
View file @
57ac5f01
...
...
@@ -25,7 +25,7 @@
cmake_minimum_required
(
VERSION 3.16
)
# set the project name
project
(
cifpp VERSION 5.0.
4
LANGUAGES CXX
)
project
(
cifpp VERSION 5.0.
5
LANGUAGES CXX
)
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
...
...
changelog
View file @
57ac5f01
Version
5.0.5
-
Fix
code
to
work
on
32
bit
machines
Version
5.0.4
-
Revert
removal
of
CIFPP_SHARE_DIR
export
...
...
include/cif++/item.hpp
View file @
57ac5f01
...
...
@@ -194,6 +194,7 @@ struct item_value
/// \brief constructor
item_value
(
std
::
string_view
text
)
:
m_length
(
text
.
length
())
,
m_storage
(
0
)
{
if
(
m_length
>=
kBufferSize
)
{
...
...
@@ -210,7 +211,7 @@ struct item_value
item_value
(
item_value
&&
rhs
)
:
m_length
(
std
::
exchange
(
rhs
.
m_length
,
0
))
,
m_
data
(
std
::
exchange
(
rhs
.
m_data
,
nullptr
))
,
m_
storage
(
std
::
exchange
(
rhs
.
m_storage
,
0
))
{
}
...
...
@@ -219,7 +220,7 @@ struct item_value
if
(
this
!=
&
rhs
)
{
m_length
=
std
::
exchange
(
rhs
.
m_length
,
m_length
);
m_
data
=
std
::
exchange
(
rhs
.
m_data
,
m_data
);
m_
storage
=
std
::
exchange
(
rhs
.
m_storage
,
m_storage
);
}
return
*
this
;
}
...
...
@@ -228,7 +229,7 @@ struct item_value
{
if
(
m_length
>=
kBufferSize
)
delete
[]
m_data
;
m_
data
=
nullptr
;
m_
storage
=
0
;
m_length
=
0
;
}
...
...
@@ -245,6 +246,7 @@ struct item_value
{
char
m_local_data
[
8
];
char
*
m_data
;
uint64_t
m_storage
;
};
static
constexpr
size_t
kBufferSize
=
sizeof
(
m_local_data
);
...
...
@@ -257,8 +259,7 @@ struct item_value
}
};
// static_assert(sizeof(item_value) == 24, "sizeof(item_value) should be 24 bytes");
static_assert
(
sizeof
(
item_value
)
==
16
,
"sizeof(item_value) should be 16 bytes"
);
static_assert
(
sizeof
(
item_value
)
==
sizeof
(
void
*
)
+
8
,
"sizeof(item_value) should be correct"
);
// --------------------------------------------------------------------
// Transient object to access stored data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment