Browse Source

remove some warnings

master
Felix von Leitner 18 years ago
parent
commit
1432291266
  1. 2
      textcode/fmt_cescape.c
  2. 2
      textcode/fmt_html.c
  3. 2
      textcode/fmt_to_array.c
  4. 2
      textcode/fmt_tofrom_array.c
  5. 2
      textcode/scan_cescape.c
  6. 10
      textcode/scan_html.c
  7. 2
      textcode/scan_to_array.c

2
textcode/fmt_cescape.c

@ -11,7 +11,7 @@ unsigned long fmt_cescape(char* dest,const char* src,unsigned long len) {
switch (s[i]) {
case '\a': c='a'; goto doescape;
case '\b': c='b'; goto doescape;
case '\e': c='e'; goto doescape;
case 0x1b: c='e'; goto doescape;
case '\f': c='f'; goto doescape;
case '\n': c='n'; goto doescape;
case '\r': c='r'; goto doescape;

2
textcode/fmt_html.c

@ -15,7 +15,7 @@ unsigned long fmt_html(char* dest,const char* src,unsigned long len) {
case '\n':
seq="<br>";
doit:
written+=fmt_str(dest?dest+written:0,"&gt;");
written+=fmt_str(dest?dest+written:0,seq);
break;
default: if (dest) dest[written]=s[i]; ++written; break;
}

2
textcode/fmt_to_array.c

@ -5,7 +5,7 @@ void fmt_to_array(unsigned long (*func)(char*,const char*,unsigned long),
array* a,const char* src,unsigned long len) {
unsigned long needed=func(0,src,len);
if (array_allocate(a,1,array_bytes(a)+needed-1)) {
char* x=array_start(a)+array_bytes(a)-needed;
char* x=((char*)array_start(a))+array_bytes(a)-needed;
func(x,src,len);
} else
array_fail(a);

2
textcode/fmt_tofrom_array.c

@ -8,7 +8,7 @@ void fmt_tofrom_array(unsigned long (*func)(char*,const char*,unsigned long),
if (array_failed(dest) || array_failed(src)) { array_fail(dest); return; }
needed=func(0,array_start(src),array_bytes(src));
if (array_allocate(dest,1,array_bytes(dest)+needed-1)) {
x=array_start(dest)+array_bytes(dest)-needed;
x=((char*)array_start(dest))+array_bytes(dest)-needed;
func(x,array_start(src),array_bytes(src));
} else
array_fail(dest);

2
textcode/scan_cescape.c

@ -11,7 +11,7 @@ unsigned long scan_cescape(const char *src,char *dest,unsigned long *destlen) {
switch (s[i+1]) {
case 'a': c='\a'; break;
case 'b': c='\b'; break;
case 'e': c='\e'; break;
case 'e': c=0x1b; break;
case 'f': c='\f'; break;
case 'n': c='\n'; break;
case 'r': c='\r'; break;

10
textcode/scan_html.c

@ -8,21 +8,21 @@ unsigned long scan_html(const char *src,char *dest,unsigned long *destlen) {
unsigned long written=0,i;
for (i=0; s[i]; ++i) {
if (s[i]=='&') {
if (case_starts(s+i+1,"amp;")) {
if (case_starts((const char*)s+i+1,"amp;")) {
dest[written]='&';
i+=4;
} else if (case_starts(s+i+1,"lt;")) {
} else if (case_starts((const char*)s+i+1,"lt;")) {
dest[written]='<';
i+=3;
} else if (case_starts(s+i+1,"gt;")) {
} else if (case_starts((const char*)s+i+1,"gt;")) {
dest[written]='>';
i+=3;
}
} else if (s[i]=='<') {
if (case_starts(s+i+1,"br>")) {
if (case_starts((const char*)s+i+1,"br>")) {
dest[written]='\n';
i+=3;
} else if (case_starts(s+i+1,"p>")) {
} else if (case_starts((const char*)s+i+1,"p>")) {
dest[written]='\n'; ++written;
dest[written]='\n';
i+=3;

2
textcode/scan_to_array.c

@ -6,7 +6,7 @@ unsigned long scan_to_array(unsigned long (*func)(const char*,char*,unsigned lon
const char* src,array* dest) {
unsigned long scanned;
unsigned long needed=str_len(src);
char* x=array_start(dest)+array_bytes(dest);
char* x=((char*)array_start(dest))+array_bytes(dest);
if (!array_allocate(dest,1,array_bytes(dest)+needed-1)) return 0;
return func(src,x,&scanned);
}

Loading…
Cancel
Save