diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-12-14 19:23:34 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-12-14 19:23:34 +0000 |
commit | 02eea9378e364fc2bd69b79e9220f389e21c45ec (patch) | |
tree | 0f7a6c60010cb6e1866de9ab20a16ccd7df2ff2e /epan | |
parent | 478f83dd2a78d9fff8fbdd171e7b011aa0605127 (diff) |
More shorten-64-to-32 warnings.
svn path=/trunk/; revision=54106
Diffstat (limited to 'epan')
-rw-r--r-- | epan/diam_dict.l | 12 | ||||
-rw-r--r-- | epan/dtd_parse.l | 4 | ||||
-rw-r--r-- | epan/radius_dict.l | 24 | ||||
-rw-r--r-- | epan/uat_load.l | 10 |
4 files changed, 25 insertions, 25 deletions
diff --git a/epan/diam_dict.l b/epan/diam_dict.l index db6a724294..032878c19e 100644 --- a/epan/diam_dict.l +++ b/epan/diam_dict.l @@ -114,7 +114,7 @@ static char** attr_str; static unsigned* attr_uint; static void ddict_debug(const char* fmt, ...); -static void append_to_buffer(const char* txt, int len); +static void append_to_buffer(const char* txt, unsigned len); static FILE* ddict_open(const char*, const char*); %} @@ -257,11 +257,11 @@ description_attr description=\042 <LOADING>{whitespace} APPEND(" ",1); -<LOADING>{dquoted} APPEND(yytext,yyleng); +<LOADING>{dquoted} APPEND(yytext, (unsigned) yyleng); <LOADING>{equals} APPEND("=",1); -<LOADING>{any} APPEND(yytext,yyleng); +<LOADING>{any} APPEND(yytext, (unsigned) yyleng); <LOADING>{entity} { char* p = ++yytext; @@ -330,7 +330,7 @@ description_attr description=\042 } <GET_UINT_ATTR>{number} { - *attr_uint = strtoul(yytext,NULL,10); + *attr_uint = (unsigned) strtoul(yytext,NULL,10); D(("%s\n",yytext);); attr_uint = NULL; BEGIN END_ATTR; @@ -561,7 +561,7 @@ void ddict_unused(void) { yy_top_state(); } -static void append_to_buffer(const char* txt, int len) { +static void append_to_buffer(const char* txt, unsigned len) { if (strbuf == NULL) { read_ptr = write_ptr = strbuf = (char*)g_malloc(size_strbuf); @@ -672,7 +672,7 @@ ddict_t* ddict_scan(const char* system_directory, const char* filename, int dbg) BEGIN LOADING; yylex(); - D(("\n---------------\n%s\n------- %d -------\n",strbuf,len_strbuf)); + D(("\n---------------\n%s\n------- %u -------\n",strbuf,len_strbuf)); current_yyinput = string_input; diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l index ef0b313ff1..b46d1cbab4 100644 --- a/epan/dtd_parse.l +++ b/epan/dtd_parse.l @@ -70,7 +70,7 @@ static gchar* location; static gchar* attr_name; - static int my_yyinput(char* buff,guint size); + static size_t my_yyinput(char* buff,size_t size); static dtd_token_data_t* new_token(gchar*); @@ -310,7 +310,7 @@ static dtd_token_data_t* new_token(gchar* text) { } -static int my_yyinput(char* buff, guint size) { +static size_t my_yyinput(char* buff, size_t size) { if (offsetx >= len ) { return YY_NULL; diff --git a/epan/radius_dict.l b/epan/radius_dict.l index d2ebdff822..a9dfb38f0a 100644 --- a/epan/radius_dict.l +++ b/epan/radius_dict.l @@ -74,7 +74,7 @@ #define MAX_INCLUDE_DEPTH 10 static void add_vendor(const gchar* name, guint32 id, guint type_octets, guint length_octets, gboolean has_flags); - static void add_value(const gchar* attrib_name,const gchar* repr, long value); + static void add_value(const gchar* attrib_name,const gchar* repr, guint32 value); static void add_tlv(const gchar* name, const gchar* code, radius_attr_dissector_t type, const gchar* attr); static void add_attribute(const gchar*,const gchar*, radius_attr_dissector_t,const gchar*, guint, gboolean, const gchar*); @@ -166,22 +166,22 @@ BEGIN VENDOR_W_NAME; } <VENDOR_W_NAME>[0-9]+ { - vendor_id = strtol(yytext,NULL,10); + vendor_id = (guint32) strtoul(yytext,NULL,10); BEGIN VENDOR_W_ID; } <VENDOR_W_NAME>0x[0-9a-f]+ { - vendor_id = strtol(yytext,NULL,16); + vendor_id = (guint32) strtoul(yytext,NULL,16); BEGIN VENDOR_W_ID; } <VENDOR_W_ID>format= { BEGIN VENDOR_W_FORMAT; } <VENDOR_W_FORMAT>[124] { - vendor_type_octets = strtol(yytext,NULL,10); + vendor_type_octets = (guint) strtoul(yytext,NULL,10); BEGIN VENDOR_W_TYPE_OCTETS; } <VENDOR_W_TYPE_OCTETS>,[012] { - vendor_length_octets = strtol(yytext+1,NULL,10); + vendor_length_octets = (guint) strtoul(yytext+1,NULL,10); BEGIN VENDOR_W_LENGTH_OCTETS; } <VENDOR_W_LENGTH_OCTETS>,c { @@ -219,7 +219,7 @@ <ATTR_W_ID>tlv { attr_type = radius_tlv; BEGIN ATTR_W_TYPE; } <ATTR_W_ID>[0-9a-z_-]+ { attr_type = radius_octets; BEGIN ATTR_W_TYPE; } <ATTR_W_TYPE>has_tag[,]? { has_tag = TRUE; } -<ATTR_W_TYPE>encrypt=[123][,]? { encrypted = strtol(yytext+8,NULL,10); } +<ATTR_W_TYPE>encrypt=[123][,]? { encrypted = (guint) strtoul(yytext+8,NULL,10); } <ATTR_W_TYPE>[0-9a-z_-]+=([^\n]*) ; <ATTR_W_TYPE>[0-9a-z_-]+ { attr_vendor = g_strdup(yytext); @@ -250,10 +250,10 @@ BEGIN WS_OUT; }; -<VALUE>[0-9a-z_/-]+ { attr_name = g_strdup(yytext); BEGIN VALUE_W_ATTR; } +<VALUE>[0-9a-z_/-]+ { attr_name = g_strdup(yytext); BEGIN VALUE_W_ATTR; } <VALUE_W_ATTR>[^[:blank:]]+ { value_repr = g_strdup(yytext); BEGIN VALUE_W_NAME; } -<VALUE_W_NAME>[0-9]+ { add_value(attr_name,value_repr,strtol(yytext,NULL,10)); g_free(attr_name); g_free(value_repr); BEGIN WS_OUT;} -<VALUE_W_NAME>0x[0-9a-f]+ { add_value(attr_name,value_repr,strtol(yytext,NULL,16)); g_free(attr_name); g_free(value_repr); BEGIN WS_OUT;} +<VALUE_W_NAME>[0-9]+ { add_value(attr_name,value_repr, (guint32) strtoul(yytext,NULL,10)); g_free(attr_name); g_free(value_repr); BEGIN WS_OUT;} +<VALUE_W_NAME>0x[0-9a-f]+ { add_value(attr_name,value_repr, (guint32) strtoul(yytext,NULL,16)); g_free(attr_name); g_free(value_repr); BEGIN WS_OUT;} <INCLUDE>[^[:blank:]\n]+ { if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) { @@ -370,7 +370,7 @@ static void add_attribute(const gchar* name, const gchar* codestr, radius_attr_ by_id = dict->attrs_by_id; } - code=strtol(codestr, NULL, 10); + code= (guint32) strtoul(codestr, NULL, 10); a=(radius_attr_info_t*)g_hash_table_lookup(by_id, GUINT_TO_POINTER(code)); @@ -432,7 +432,7 @@ static void add_tlv(const gchar* name, const gchar* codestr, radius_attr_dissec a->tlvs_by_id = g_hash_table_new(g_direct_hash,g_direct_equal); } - code=strtol(codestr, NULL, 10); + code = (guint32) strtoul(codestr, NULL, 10); s = (radius_attr_info_t*)g_hash_table_lookup(a->tlvs_by_id, GUINT_TO_POINTER(code)); @@ -463,7 +463,7 @@ static void add_tlv(const gchar* name, const gchar* codestr, radius_attr_dissec g_hash_table_insert(dict->tlvs_by_name,(gpointer) (s->name),s); } -void add_value(const gchar* attrib_name, const gchar* repr, long value) { +void add_value(const gchar* attrib_name, const gchar* repr, guint32 value) { value_string v; GArray* a = (GArray*)g_hash_table_lookup(value_strings,attrib_name); diff --git a/epan/uat_load.l b/epan/uat_load.l index dd42dd80b3..815f25b139 100644 --- a/epan/uat_load.l +++ b/epan/uat_load.l @@ -113,8 +113,8 @@ static guint parse_str_pos; #define YY_INPUT(buf,result,max_size) \ if ( parse_str ) \ { \ - int n = 0; \ - guint pslen = strlen(parse_str); \ + size_t n = 0; \ + size_t pslen = strlen(parse_str); \ if (parse_str_pos < pslen) \ { \ n = pslen - parse_str_pos; \ @@ -180,11 +180,11 @@ comment #[^\n]*\n BEGIN END_OF_RECORD; - yyless(yyleng); + yyless((int) yyleng); } <START_OF_LINE,NEXT_FIELD>{quoted_string} { - ptrx = uat_undquote(yytext,yyleng,&len); + ptrx = uat_undquote(yytext, (guint) yyleng, &len); if (colnum < uat->ncols - 1) { @@ -197,7 +197,7 @@ comment #[^\n]*\n } <START_OF_LINE,NEXT_FIELD>{binstring} { - ptrx = uat_unbinstring(yytext,yyleng,&len); + ptrx = uat_unbinstring(yytext, (guint) yyleng, &len); if (!ptrx) { ERROR(("uneven hexstring for field %s",uat->fields[colnum].name)); |