SHA256
1
0
forked from pool/bzflag
bzflag/bzflag-char-signedness.patch

37 lines
1.1 KiB
Diff

DynamicColor.cxx:202: warning: comparison is always false due to limited range of data type
Index: bzflag-2.0.2.20050318/include/DynamicColor.h
===================================================================
--- bzflag-2.0.2.20050318.orig/include/DynamicColor.h
+++ bzflag-2.0.2.20050318/include/DynamicColor.h
@@ -21,7 +21,7 @@
typedef struct sequenceList {
float period;
float offset;
- char* list;
+ signed char* list;
unsigned int count;
} sequenceParams;
--- bzflag-2.0.2.20050318.orig/src/game/DynamicColor.cxx
+++ bzflag-2.0.2.20050318/src/game/DynamicColor.cxx
@@ -304,7 +304,7 @@
seq.period = period;
seq.offset = offset;
seq.count = (unsigned int)list.size();
- seq.list = new char[seq.count];
+ seq.list = new signed char[seq.count];
for (unsigned int i = 0; i < seq.count; i++) {
seq.list[i] = list[i];
}
@@ -541,7 +541,7 @@
if (size > 0) {
buf = nboUnpackFloat (buf, seq.period);
buf = nboUnpackFloat (buf, seq.offset);
- seq.list = new char[size];
+ seq.list = new signed char[size];
for (i = 0; i < size; i++) {
uint8_t value;
buf = nboUnpackUByte (buf, value);