Skip to content

Commit

Permalink
Merge pull request glKarin#269 from ArtemS2/master
Browse files Browse the repository at this point in the history
fix build rbdoom3bfg linux arm64
  • Loading branch information
glKarin authored Nov 8, 2024
2 parents 7c2d1f0 + b49159e commit 5ad9d97
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
50 changes: 33 additions & 17 deletions Q3E/src/main/jni/doom3bfg/neo/idlib/DataQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,39 @@ idDataQueue::Append
template< int maxItems, int maxBuffer >
bool idDataQueue< maxItems, maxBuffer >::Append( int sequence, const byte* b1, int b1Len, const byte* b2, int b2Len )
{
if( items.Num() == items.Max() )
{
return false;
}
if( dataLength + b1Len + b2Len >= maxBuffer )
{
return false;
}
msgItem_t& item = *items.Alloc();
item.length = b1Len + b2Len;
item.sequence = sequence;
item.dataOffset = dataLength;
memcpy( data + dataLength, b1, b1Len );
dataLength += b1Len;
memcpy( data + dataLength, b2, b2Len );
dataLength += b2Len;
return true;

if (b1 == NULL || b1Len < 0) {
return false;
}


if (b2 == NULL) {
b2Len = 0;
}

if (items.Num() == items.Max()) {
return false;
}
if (dataLength + b1Len + b2Len >= maxBuffer) {
return false;
}

msgItem_t& item = *items.Alloc();
item.length = b1Len + b2Len;
item.sequence = sequence;
item.dataOffset = dataLength;


memcpy(data + dataLength, b1, b1Len);
dataLength += b1Len;


if (b2Len > 0) {
memcpy(data + dataLength, b2, b2Len);
dataLength += b2Len;
}
//ArtemS2 fix :)
return true;
}

#endif // DATAQUEUE_H
2 changes: 1 addition & 1 deletion cmake_linux_build_doom3bfg.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TARGET_PATH="`pwd`/Q3E/src/main/jni/doom3bfg/neo";
cd ${TARGET_PATH};

echo "Configure and generate GNU makefile ......";
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} CMakeLists.txt;
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="-Werror=nonnull" CMakeLists.txt;

echo "Build ${BUILD_TYPE} ......";
make;
Expand Down

0 comments on commit 5ad9d97

Please sign in to comment.