get rid of some compiler warnings

master
leitner 11 years ago
parent 35382a430e
commit 73db80daec

@ -3,7 +3,7 @@
size_t fmt_longlong(char *dest,signed long long int i) { size_t fmt_longlong(char *dest,signed long long int i) {
if (i<0) { if (i<0) {
if (dest) *dest++='-'; if (dest) *dest++='-';
return fmt_ulonglong(dest,-i)+1; return fmt_ulonglong(dest,(unsigned long long)-i)+1;
} else } else
return fmt_ulonglong(dest,i); return fmt_ulonglong(dest,(unsigned long long)i);
} }

@ -9,5 +9,5 @@ size_t fmt_str(char *out,const char *in) {
if (!*t) break; if (s) { *s=*t; ++s; } ++t; if (!*t) break; if (s) { *s=*t; ++s; } ++t;
if (!*t) break; if (s) { *s=*t; ++s; } ++t; if (!*t) break; if (s) { *s=*t; ++s; } ++t;
} }
return t-in; return (size_t)(t-in);
} }

@ -3,7 +3,7 @@
size_t fmt_utf8(char *dest,uint32_t n) { size_t fmt_utf8(char *dest,uint32_t n) {
size_t i,j; size_t i,j;
if (n<=0x7f) { if (n<=0x7f) {
if (dest) *dest=n; if (dest) *dest=(char)n;
return 1; return 1;
} }
for (i=0x3f,j=1; i<0x7fffffff; i=(i<<5)|0x1f, ++j) { for (i=0x3f,j=1; i<0x7fffffff; i=(i<<5)|0x1f, ++j) {
@ -11,9 +11,9 @@ size_t fmt_utf8(char *dest,uint32_t n) {
--j; --j;
if (dest) { if (dest) {
size_t k=j*6; size_t k=j*6;
*dest++=((char)0xc0 >> (j-1)) | (n >> k); *dest++=(char)(((char)0xc0 >> (j-1)) | (char)(n >> k));
while (k) { while (k) {
*dest++=0x80 | ((n >> (k-6)) & 0x3f); *dest++=(char)(0x80 | ((n >> (k-6)) & 0x3f));
k-=6; k-=6;
} }
} }

Loading…
Cancel
Save