src/string.c

changeset 593
ea9b41b5ebbc
parent 591
7df0bcaecffa
child 628
1e2be40f0cb5
equal deleted inserted replaced
592:bb69ef3ad1f3 593:ea9b41b5ebbc
29 #include "cx/string.h" 29 #include "cx/string.h"
30 #include "cx/utils.h" 30 #include "cx/utils.h"
31 31
32 #include <string.h> 32 #include <string.h>
33 #include <stdarg.h> 33 #include <stdarg.h>
34 #include <stdint.h>
35 #include <ctype.h> 34 #include <ctype.h>
36 35
37 #ifndef _WIN32 36 #ifndef _WIN32
38 37
39 #include <strings.h> /* for strncasecmp() */ 38 #include <strings.h> /* for strncasecmp() */
527 #endif 526 #endif
528 } 527 }
529 528
530 void cx_strlower(cxmutstr string) { 529 void cx_strlower(cxmutstr string) {
531 cx_for_n(i, string.length) { 530 cx_for_n(i, string.length) {
532 string.ptr[i] = tolower(string.ptr[i]); 531 string.ptr[i] = (char) tolower(string.ptr[i]);
533 } 532 }
534 } 533 }
535 534
536 void cx_strupper(cxmutstr string) { 535 void cx_strupper(cxmutstr string) {
537 cx_for_n(i, string.length) { 536 cx_for_n(i, string.length) {
538 string.ptr[i] = toupper(string.ptr[i]); 537 string.ptr[i] = (char) toupper(string.ptr[i]);
539 } 538 }
540 } 539 }
541 540
542 #define REPLACE_INDEX_BUFFER_MAX 100 541 #define REPLACE_INDEX_BUFFER_MAX 100
543 542

mercurial