diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-10-17 22:55:35 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-10-17 22:55:35 (GMT) |
commit | 2cfb66fcd5e8293d1dd689691bdc8c3517dd183a (patch) | |
tree | fd4536a69473c5c4d8204d052813f764286ea0ab /src | |
parent | af29afcc9a37113e4187b1c0a20e3bf5e2dcd4d9 (diff) |
Fixed other gcc warnings.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@273 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src')
-rwxr-xr-x | src/common/endianness.c | 30 | ||||
-rwxr-xr-x | src/common/endianness.h | 10 | ||||
-rw-r--r-- | src/common/environment.c | 2 | ||||
-rw-r--r-- | src/common/extstr.c | 10 | ||||
-rw-r--r-- | src/common/xml.c | 4 | ||||
-rw-r--r-- | src/common/xml.h | 2 |
6 files changed, 26 insertions, 32 deletions
diff --git a/src/common/endianness.c b/src/common/endianness.c index 072b767..46a3be2 100755 --- a/src/common/endianness.c +++ b/src/common/endianness.c @@ -139,8 +139,9 @@ bool read_u16(uint16_t *target, const bin_t *data, off_t *pos, off_t len, Source break; - - + case SRE_MIDDLE: + /* TODO */ + break; case SRE_BIG: @@ -213,6 +214,10 @@ bool read_u32(uint32_t *target, const bin_t *data, off_t *pos, off_t len, Source break; + case SRE_MIDDLE: + /* TODO */ + break; + case SRE_BIG: #if __BYTE_ORDER == __LITTLE_ENDIAN @@ -290,6 +295,10 @@ bool read_u64(uint64_t *target, const bin_t *data, off_t *pos, off_t len, Source break; + case SRE_MIDDLE: + /* TODO */ + break; + case SRE_BIG: #if __BYTE_ORDER == __LITTLE_ENDIAN @@ -324,11 +333,6 @@ bool read_u64(uint64_t *target, const bin_t *data, off_t *pos, off_t len, Source } - - - - - /****************************************************************************** * * * Paramètres : value = source de la valeur à transcrire. * @@ -406,12 +410,6 @@ bool _write_un(const bin_t *value, size_t size, bin_t *data, off_t *pos, off_t l } - - - - - - /****************************************************************************** * * * Paramètres : target = lieu d'enregistrement de la lecture. [OUT] * @@ -461,7 +459,6 @@ bool strtou8(uint8_t *target, const char *data, size_t *pos, size_t len, SourceE } - /****************************************************************************** * * * Paramètres : n = nombre d'octets constituant le nombre à lire. * @@ -551,7 +548,6 @@ bool _strtoun(uint8_t n, const char *data, size_t *pos, size_t len, SourceEndian break; default: - printf(" string :: '%s'\n", &data[*pos + j]); result = false; break; @@ -579,6 +575,10 @@ bool _strtoun(uint8_t n, const char *data, size_t *pos, size_t len, SourceEndian break; + case SRE_MIDDLE: + /* TODO */ + break; + case SRE_BIG: #if __BYTE_ORDER == __LITTLE_ENDIAN diff --git a/src/common/endianness.h b/src/common/endianness.h index a6bf582..c39d702 100755 --- a/src/common/endianness.h +++ b/src/common/endianness.h @@ -36,8 +36,8 @@ typedef enum _SourceEndian { SRE_LITTLE, /* Petits boutistes */ - SRE_BIG, /* Gros boutistes */ - SRE_MIDDLE /* Moyens boutistes */ + SRE_MIDDLE, /* Moyens boutistes */ + SRE_BIG /* Gros boutistes */ } SourceEndian; @@ -65,7 +65,6 @@ bool read_u64(uint64_t *, const bin_t *, off_t *, off_t, SourceEndian); #define read_s64(target, data, pos, len, endian) read_u64((uint64_t *)target, data, pos, len, endian) - /* Ecrit un nombre non signé sur n octets. */ bool _write_un(const bin_t *, size_t, bin_t *, off_t *, off_t, SourceEndian); @@ -89,14 +88,9 @@ bool _write_un(const bin_t *, size_t, bin_t *, off_t *, off_t, SourceEndian); #define write_s64(value, data, pos, len, endian) write_un(value, data, pos, len, endian, sint64_t) - - - /* Lit un nombre hexadécimal non signé sur deux octets. */ bool strtou8(uint8_t *, const char *, size_t *, size_t, SourceEndian); - - /* Lit un nombre hexadécimal non signé sur n octets. */ bool _strtoun(uint8_t, const char *, size_t *, size_t, SourceEndian, ...); diff --git a/src/common/environment.c b/src/common/environment.c index 50b75f8..2a4115f 100644 --- a/src/common/environment.c +++ b/src/common/environment.c @@ -85,7 +85,7 @@ bool add_to_env_var(const char *name, const char *value, const char *sep) content = stradd(content, value); ret = setenv(name, content, 1); - if (ret != 0) perror(setenv); + if (ret != 0) perror("setenv"); free(content); diff --git a/src/common/extstr.c b/src/common/extstr.c index 17cffec..87d0b13 100644 --- a/src/common/extstr.c +++ b/src/common/extstr.c @@ -138,7 +138,6 @@ char *strrpl(char *haystack, const char *needle1, const char *needle2) size_t len1; /* Taille de l'aiguille n°1 */ size_t len2; /* Taille de l'aiguille n°2 */ regex_t preg; /* Expression régulière */ - int ret; /* Bilan de l'appel */ size_t curpos; /* Point de recherche */ regmatch_t pmatch; /* Résultats remontés */ @@ -146,8 +145,8 @@ char *strrpl(char *haystack, const char *needle1, const char *needle2) len1 = strlen(needle1); len2 = strlen(needle2); - ret = regcomp(&preg, needle1, REG_EXTENDED | REG_ICASE); - /* TODO: ret */ + /* On considère que la compilation est toujours bonne... */ + regcomp(&preg, needle1, REG_EXTENDED | REG_ICASE); for (curpos = 0; regexec(&preg, &haystack[curpos], 1, &pmatch, 0) != REG_NOMATCH; ) { @@ -236,14 +235,13 @@ char *escape_crlf(char *input) { size_t inlen; regex_t preg; - int ret; size_t curpos; regmatch_t pmatch[2]; inlen = strlen(input); - ret = regcomp(&preg, "(\t|\n|\r)", REG_EXTENDED | REG_ICASE); - /* TODO: ret */ + /* On considère que la compilation est toujours bonne... */ + regcomp(&preg, "(\t|\n|\r)", REG_EXTENDED | REG_ICASE); for (curpos = 0; regexec(&preg, &input[curpos], 2, pmatch, 0) != REG_NOMATCH; ) { diff --git a/src/common/xml.c b/src/common/xml.c index 1129d9c..5612247 100644 --- a/src/common/xml.c +++ b/src/common/xml.c @@ -713,7 +713,9 @@ xmlNodePtr add_node_to_xpath(xmlDocPtr xdoc, xmlXPathContextPtr context, const c parent = get_node_from_xpath(context, path); if (parent == NULL) return NULL; - return add_node_to_node(xdoc, parent, name); + result = add_node_to_node(xdoc, parent, name); + + return result; } diff --git a/src/common/xml.h b/src/common/xml.h index b7fbc4c..f96f65a 100644 --- a/src/common/xml.h +++ b/src/common/xml.h @@ -112,7 +112,7 @@ bool write_xml_content(xmlTextWriterPtr, const char *, ...); xmlNodePtr get_node_from_xpath(xmlXPathContextPtr, const char *); /* Ajoute un noeud à un autre noeud. */ -xmlNodePtr add_node_to_path(xmlDocPtr, xmlXPathContextPtr, const char *, const char *); +xmlNodePtr add_node_to_xpath(xmlDocPtr, xmlXPathContextPtr, const char *, const char *); /* Ajoute un noeud à un autre noeud. */ xmlNodePtr add_node_to_node(xmlDocPtr, xmlNodePtr, const char *); |