diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-12-26 05:57:06 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-12-26 05:57:06 +0000 |
commit | 8ed7a73e22c049a2e013bb436e599bff41fc5b9b (patch) | |
tree | ad4a4cc6fb4ff4d3e3ffe3a3f8e3d056e441ae46 /plugins/wimaxasncp/wimaxasncp_dict.l | |
parent | 8ede6b7dc09aa636f87147ab432a137c209e8aca (diff) |
Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().
Change some data types to avoid those implicit conversion warnings.
When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.
Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers. Cast
away those warnings in some cases where an API we don't control forces
us to do so.
Enable a bunch of additional warnings by default. Note why at least
some of the other warnings aren't enabled.
randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.
If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.
svn path=/trunk/; revision=46748
Diffstat (limited to 'plugins/wimaxasncp/wimaxasncp_dict.l')
-rw-r--r-- | plugins/wimaxasncp/wimaxasncp_dict.l | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/wimaxasncp/wimaxasncp_dict.l b/plugins/wimaxasncp/wimaxasncp_dict.l index 71259ef51c..9c55a79d97 100644 --- a/plugins/wimaxasncp/wimaxasncp_dict.l +++ b/plugins/wimaxasncp/wimaxasncp_dict.l @@ -85,7 +85,7 @@ typedef struct entity_t { #define MAX_INCLUDE_DEPTH 10 #define YY_INPUT(buf,result,max_size) { result = current_yyinput(buf,max_size); } #define ECHO -#define APPEND(txt,len) append_to_buffer(txt,len) +#define APPEND(txt,len) append_to_buffer(txt,(int)len) static entity_t ents; static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; @@ -108,7 +108,7 @@ static gint16 *attr_uint16; static guint wimaxasncp_bits(guint bits, char *n); static gint wimaxasncp_decode_type(const gchar *name); static void wimaxasncp_dict_debug(const gchar *fmt, ...); -static void append_to_buffer(gchar *txt, int len); +static void append_to_buffer(const gchar *txt, int len); static FILE *wimaxasncp_dict_open(const gchar*, const gchar*); static GString *dict_error = NULL; @@ -313,7 +313,7 @@ since_attr since=\042 } <GET_UINT_ATTR>{number} { - *attr_uint = strtoul(yytext,NULL,0); + *attr_uint = (guint)strtoul(yytext,NULL,0); D(("%s\n",yytext);); attr_uint = NULL; BEGIN END_ATTR; @@ -531,7 +531,7 @@ void wimaxasncp_dict_unused(void) { yy_top_state(); } -static void append_to_buffer(gchar *txt, int len) { +static void append_to_buffer(const gchar *txt, int len) { if (strbuf == NULL) { read_ptr = write_ptr = strbuf = g_malloc(size_strbuf); |