@@ -41,6 +41,7 @@ typedef long long ssize_t;
41
41
#endif
42
42
43
43
#include <sys/types.h>
44
+
44
45
#include <stdarg.h>
45
46
#include <stdint.h>
46
47
@@ -89,7 +90,7 @@ struct __attribute__ ((__packed__)) sdshdr64 {
89
90
#define SDS_TYPE_5_LEN (f ) ((f)>>SDS_TYPE_BITS)
90
91
91
92
static inline size_t sdslen (const sds s ) {
92
- unsigned char flags = s [-1 ];
93
+ unsigned char flags = ( unsigned char ) s [-1 ];
93
94
switch (flags & SDS_TYPE_MASK ) {
94
95
case SDS_TYPE_5 :
95
96
return SDS_TYPE_5_LEN (flags );
@@ -106,7 +107,7 @@ static inline size_t sdslen(const sds s) {
106
107
}
107
108
108
109
static inline size_t sdsavail (const sds s ) {
109
- unsigned char flags = s [-1 ];
110
+ unsigned char flags = ( unsigned char ) s [-1 ];
110
111
switch (flags & SDS_TYPE_MASK ) {
111
112
case SDS_TYPE_5 : {
112
113
return 0 ;
@@ -132,7 +133,7 @@ static inline size_t sdsavail(const sds s) {
132
133
}
133
134
134
135
static inline void sdssetlen (sds s , size_t newlen ) {
135
- unsigned char flags = s [-1 ];
136
+ unsigned char flags = ( unsigned char ) s [-1 ];
136
137
switch (flags & SDS_TYPE_MASK ) {
137
138
case SDS_TYPE_5 :
138
139
{
@@ -156,7 +157,7 @@ static inline void sdssetlen(sds s, size_t newlen) {
156
157
}
157
158
158
159
static inline void sdsinclen (sds s , size_t inc ) {
159
- unsigned char flags = s [-1 ];
160
+ unsigned char flags = ( unsigned char ) s [-1 ];
160
161
switch (flags & SDS_TYPE_MASK ) {
161
162
case SDS_TYPE_5 :
162
163
{
@@ -182,7 +183,7 @@ static inline void sdsinclen(sds s, size_t inc) {
182
183
183
184
/* sdsalloc() = sdsavail() + sdslen() */
184
185
static inline size_t sdsalloc (const sds s ) {
185
- unsigned char flags = s [-1 ];
186
+ unsigned char flags = ( unsigned char ) s [-1 ];
186
187
switch (flags & SDS_TYPE_MASK ) {
187
188
case SDS_TYPE_5 :
188
189
return SDS_TYPE_5_LEN (flags );
@@ -199,7 +200,7 @@ static inline size_t sdsalloc(const sds s) {
199
200
}
200
201
201
202
static inline void sdssetalloc (sds s , size_t newlen ) {
202
- unsigned char flags = s [-1 ];
203
+ unsigned char flags = ( unsigned char ) s [-1 ];
203
204
switch (flags & SDS_TYPE_MASK ) {
204
205
case SDS_TYPE_5 :
205
206
/* Nothing to do, this type has no total allocation info. */
0 commit comments