Browse Source

get rid of some compiler warnings

master
Felix von Leitner 6 years ago
parent
commit
4381f7c6a2
3 changed files with 6 additions and 6 deletions
  1. +2
    -2
      fmt/fmt_longlong.c
  2. +1
    -1
      fmt/fmt_str.c
  3. +3
    -3
      fmt/fmt_utf8.c

+ 2
- 2
fmt/fmt_longlong.c View File

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

+ 1
- 1
fmt/fmt_str.c View File

@@ -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;
}
return t-in;
return (size_t)(t-in);
}

+ 3
- 3
fmt/fmt_utf8.c View File

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


Loading…
Cancel
Save