Ver a proveniência

remove new compiler warnings from gcc 7

master
Felix von Leitner há 3 anos
ascendente
cometimento
818f2dc2e9
8 ficheiros alterados com 9 adições e 6 eliminações
  1. +1
    -0
      ent.c
  2. +2
    -2
      scan/scan_double.c
  3. +1
    -1
      scan/scan_int.c
  4. +1
    -1
      scan/scan_longn.c
  5. +1
    -1
      scan/scan_plusminus.c
  6. +1
    -1
      scan/scan_short.c
  7. +1
    -0
      t.c
  8. +1
    -0
      textcode/fmt_yenc.c

+ 1
- 0
ent.c Ver ficheiro

@@ -8,6 +8,7 @@
#include "scan/scan_ulong.c"
#include "scan/scan_ulongn.c"
#include "fmt/fmt_utf8.c"
#include "fmt/fmt_tohex.c"
#include "fmt/fmt_escapecharc.c"

char tmp[20];


+ 2
- 2
scan/scan_double.c Ver ficheiro

@@ -11,7 +11,7 @@ size_t scan_double(const char *in, double *dest) {
register const char *c=in;
char neg=0;
switch (*c) {
case '-': neg=1;
case '-': neg=1; /* fall through */
case '+': c++; break;
default: break;
}
@@ -31,7 +31,7 @@ size_t scan_double(const char *in, double *dest) {
char neg=0;
if (c[1]<'0') {
switch (*c) {
case '-': neg=1;
case '-': neg=1; /* fall through */
case '+': c++; break;
default:
d=0;


+ 1
- 1
scan/scan_int.c Ver ficheiro

@@ -10,7 +10,7 @@ size_t scan_int(const char* src,int* dest) {
int ok;
tmp=src; l=0; ok=0; neg=0;
switch (*tmp) {
case '-': neg=1;
case '-': neg=1; /* fall through */
case '+': ++tmp;
}
while ((c=(unsigned char)(*tmp-'0'))<10) {


+ 1
- 1
scan/scan_longn.c Ver ficheiro

@@ -11,7 +11,7 @@ size_t scan_longn(const char *src,size_t n,long *dest) {
if (!n--) return 0;
tmp=src; l=0; ok=0; neg=0;
switch (*tmp) {
case '-': neg=1;
case '-': neg=1; /* fall through */
case '+': ++tmp;
}
while (n-->0 && (c=(unsigned char)(*tmp-'0'))<10) {


+ 1
- 1
scan/scan_plusminus.c Ver ficheiro

@@ -3,7 +3,7 @@
size_t scan_plusminus(const char *src,signed int *dest) {
*dest=1;
switch (*src) {
case '-': *dest=-1;
case '-': *dest=-1; /* fall through */
case '+': return 1; break;
}
return 0;


+ 1
- 1
scan/scan_short.c Ver ficheiro

@@ -10,7 +10,7 @@ size_t scan_short(const char* src,short* dest) {
int ok;
tmp=src; l=0; ok=neg=0;
switch (*tmp) {
case '-': neg=1;
case '-': neg=1; /* fall through */
case '+': ++tmp;
}
while ((c=(unsigned char)(*tmp-'0'))<10) {


+ 1
- 0
t.c Ver ficheiro

@@ -126,6 +126,7 @@ int main(int argc,char* argv[]) {
(void)writecb;
(void)argc;
(void)argv;
(void)c;
assert(fmt_jsonescape(buf,"foo\nbar\\",8)==10 && byte_equal(buf,10,"foo\\nbar\\\\"));
memset(buf,0,sizeof(buf));
assert(scan_jsonescape("foo\\u000abar\\\\",buf,&l)==14 && l==8 && byte_equal(buf,8,"foo\nbar\\"));


+ 1
- 0
textcode/fmt_yenc.c Ver ficheiro

@@ -16,6 +16,7 @@ size_t fmt_yenc(char* dest,const char* src,size_t len) {
goto dontescape;
case 'F': /* escape "^From " */
if (s[i+1]+42!='r' || s[i+2]+42!='o' || s[i+3]+42!='m' || s[i+4]+42!=' ') goto dontescape;
/* fall through */
case '.': /* dot at start of line needs to be escaped */
if (!linelen) goto dontescape;
/* fall through */


Carregando…
Cancelar
Guardar