diff options
39 files changed, 173 insertions, 173 deletions
diff --git a/epan/camel-persistentdata.c b/epan/camel-persistentdata.c index 74e1f418a6..c7d7ed1cc5 100644 --- a/epan/camel-persistentdata.c +++ b/epan/camel-persistentdata.c @@ -127,9 +127,9 @@ guint32 camelsrt_global_SessionId=1; #ifdef DEBUG_CAMELSRT #include <stdio.h> #include <stdarg.h> -static unsigned debug_level = 99; +static guint debug_level = 99; -static void dbg(unsigned level, char *fmt, ...) { +static void dbg(guint level, char *fmt, ...) { va_list ap; if (level > debug_level) return; diff --git a/epan/crypt/md5.c b/epan/crypt/md5.c index 916b19e316..aaf6107f4c 100644 --- a/epan/crypt/md5.c +++ b/epan/crypt/md5.c @@ -143,7 +143,7 @@ void md5_append( md5_state_t *ctx, unsigned char const *buf, size_t len) */ void md5_finish(md5_state_t *ctx, unsigned char digest[16]) { - unsigned count; + guint count; unsigned char *p; /* Compute number of bytes mod 64 */ diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c index 3c43191515..f4dd745cfa 100644 --- a/epan/dfilter/dfilter-macro.c +++ b/epan/dfilter/dfilter-macro.c @@ -579,7 +579,7 @@ static void* macro_copy(void* dest, const void* orig, size_t len _U_) { return d; } -static gboolean macro_name_chk(void* r _U_, const char* in_name, unsigned name_len, const void* u1 _U_, const void* u2 _U_, const char** error) { +static gboolean macro_name_chk(void* r _U_, const char* in_name, guint name_len, const void* u1 _U_, const void* u2 _U_, const char** error) { guint i; if (name_len == 0) { diff --git a/epan/diam_dict.h b/epan/diam_dict.h index 6840ae01b0..9f0a4f601e 100644 --- a/epan/diam_dict.h +++ b/epan/diam_dict.h @@ -27,7 +27,7 @@ struct _ddict_namecode_t { char* name; - unsigned code; + guint code; struct _ddict_namecode_t* next; }; @@ -38,7 +38,7 @@ typedef struct _ddict_namecode_t ddict_application_t; typedef struct _ddict_vendor_t { char* name; char* desc; - unsigned code; + guint code; struct _ddict_vendor_t* next; } ddict_vendor_t; @@ -47,7 +47,7 @@ typedef struct _ddict_avp_t { char* description; char* vendor; char* type; - unsigned code; + guint code; ddict_gavp_t* gavps; ddict_enum_t* enums; struct _ddict_avp_t* next; @@ -62,7 +62,7 @@ typedef struct _ddict_typedefn_t { typedef struct _ddict_cmd_t { char* name; char* vendor; - unsigned code; + guint code; struct _ddict_cmd_t* next; } ddict_cmd_t; diff --git a/epan/dissectors/packet-babel.c b/epan/dissectors/packet-babel.c index deff931901..9dce3953b1 100644 --- a/epan/dissectors/packet-babel.c +++ b/epan/dissectors/packet-babel.c @@ -124,7 +124,7 @@ network_prefix(int ae, int plen, unsigned int omitted, const unsigned char *p, const unsigned char *dp, unsigned int len, unsigned char *p_r) { - unsigned pb; + guint pb; unsigned char prefix[16]; if (plen >= 0) diff --git a/epan/dissectors/packet-dmx-chan.c b/epan/dissectors/packet-dmx-chan.c index 9e7671f1ac..66e99c5915 100644 --- a/epan/dissectors/packet-dmx-chan.c +++ b/epan/dissectors/packet-dmx-chan.c @@ -76,7 +76,7 @@ dissect_dmx_chan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *item; guint16 length,r,c,row_count; guint8 v; - unsigned offset = 0; + guint offset = 0; proto_tree *ti = proto_tree_add_item(tree, proto_dmx_chan, tvb, offset, -1, ENC_NA); proto_tree *dmx_chan_tree = proto_item_add_subtree(ti, ett_dmx_chan); diff --git a/epan/dissectors/packet-dmx-sip.c b/epan/dissectors/packet-dmx-sip.c index bfb93aa273..74a81b346f 100644 --- a/epan/dissectors/packet-dmx-sip.c +++ b/epan/dissectors/packet-dmx-sip.c @@ -67,10 +67,10 @@ static int hf_dmx_sip_trailer = -1; static int ett_dmx_sip = -1; static guint8 -dmx_sip_checksum(tvbuff_t *tvb, unsigned length) +dmx_sip_checksum(tvbuff_t *tvb, guint length) { guint8 sum = DMX_SC_SIP; - unsigned i; + guint i; for (i = 0; i < length; i++) sum += tvb_get_guint8(tvb, i); return sum; @@ -83,9 +83,9 @@ dissect_dmx_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->cinfo, COL_INFO); if (tree != NULL) { - unsigned offset = 0; - unsigned byte_count; - unsigned checksum, checksum_shouldbe; + guint offset = 0; + guint byte_count; + guint checksum, checksum_shouldbe; proto_item *item; proto_tree *checksum_tree; diff --git a/epan/dissectors/packet-dmx-test.c b/epan/dissectors/packet-dmx-test.c index 71f4a32c30..e17e0ab3c1 100644 --- a/epan/dissectors/packet-dmx-test.c +++ b/epan/dissectors/packet-dmx-test.c @@ -58,8 +58,8 @@ dissect_dmx_test(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->cinfo, COL_INFO); if (tree != NULL) { - unsigned offset = 0; - unsigned size, i, test_data_is_ok; + guint offset = 0; + guint size, i, test_data_is_ok; proto_tree *test_data_tree; proto_item *item; diff --git a/epan/dissectors/packet-dmx-text.c b/epan/dissectors/packet-dmx-text.c index 20ed974169..29397efebd 100644 --- a/epan/dissectors/packet-dmx-text.c +++ b/epan/dissectors/packet-dmx-text.c @@ -55,8 +55,8 @@ dissect_dmx_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->cinfo, COL_INFO); if (tree != NULL) { - unsigned offset = 0; - unsigned size; + guint offset = 0; + guint size; proto_tree *ti = proto_tree_add_item(tree, proto_dmx_text, tvb, offset, -1, FALSE); diff --git a/epan/dissectors/packet-dmx.c b/epan/dissectors/packet-dmx.c index 7ba60ed8ec..db2a563e19 100644 --- a/epan/dissectors/packet-dmx.c +++ b/epan/dissectors/packet-dmx.c @@ -74,7 +74,7 @@ static void dissect_dmx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { tvbuff_t *next_tvb; - unsigned offset = 0; + guint offset = 0; guint8 start_code; col_set_str(pinfo->cinfo, COL_PROTOCOL, "DMX"); diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c index 53065b5849..bb5b915d1b 100644 --- a/epan/dissectors/packet-k12.c +++ b/epan/dissectors/packet-k12.c @@ -360,7 +360,7 @@ k12_free_cb(void* r) static gboolean -protos_chk_cb(void* r _U_, const char* p, unsigned len, const void* u1 _U_, const void* u2 _U_, const char** err) +protos_chk_cb(void* r _U_, const char* p, guint len, const void* u1 _U_, const void* u2 _U_, const char** err) { gchar** protos; gchar* line = ep_strndup(p,len); diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c index 0306bba21a..ce616ece01 100644 --- a/epan/dissectors/packet-pdcp-lte.c +++ b/epan/dissectors/packet-pdcp-lte.c @@ -240,11 +240,11 @@ typedef struct { /* Using bit fields to fit into 32 bits, so avoiding the need to allocate heap memory for these structs */ - unsigned ueId : 16; - unsigned plane : 2; - unsigned channelId : 6; - unsigned direction : 1; - unsigned notUsed : 7; + guint ueId : 16; + guint plane : 2; + guint channelId : 6; + guint direction : 1; + guint notUsed : 7; } pdcp_channel_hash_key; /* Channel state */ @@ -276,12 +276,12 @@ static guint pdcp_channel_hash_func(gconstpointer v) /* Hash table types & functions for frame reports */ typedef struct { - guint32 frameNumber; - unsigned SN : 15; - unsigned plane : 2; - unsigned channelId: 5; - unsigned direction: 1; - unsigned notUsed : 9; + guint32 frameNumber; + guint32 SN : 15; + guint32 plane : 2; + guint32 channelId: 5; + guint32 direction: 1; + guint32 notUsed : 9; } pdcp_result_hash_key; static gint pdcp_result_hash_equal(gconstpointer v, gconstpointer v2) diff --git a/epan/dissectors/packet-pw-atm.c b/epan/dissectors/packet-pw-atm.c index 135ddd2c7f..d3d37c45ad 100644 --- a/epan/dissectors/packet-pw-atm.c +++ b/epan/dissectors/packet-pw-atm.c @@ -347,7 +347,7 @@ static void prepare_pseudo_header_atm( union wtap_pseudo_header * const ph, const pwatm_private_data_t * const pdata, - const unsigned aal) + const guint aal) { DISSECTOR_ASSERT(NULL != pdata); DISSECTOR_ASSERT(NULL != ph); diff --git a/epan/dissectors/packet-rlc-lte.c b/epan/dissectors/packet-rlc-lte.c index a8f5b8cfef..f0402674c8 100644 --- a/epan/dissectors/packet-rlc-lte.c +++ b/epan/dissectors/packet-rlc-lte.c @@ -331,10 +331,10 @@ static guint16 s_lengths[MAX_RLC_SDUS]; /* Channel key */ typedef struct { - unsigned ueId : 16; - unsigned channelType : 3; - unsigned channelId : 5; - unsigned direction : 1; + guint ueId : 16; + guint channelType : 3; + guint channelId : 5; + guint direction : 1; } channel_hash_key; @@ -899,11 +899,11 @@ static guint rlc_channel_hash_func(gconstpointer v) /* Result hash */ typedef struct { - guint32 frameNumber; - unsigned SN : 10; - unsigned channelType : 2; - unsigned channelId: 5; - unsigned direction: 1; + guint32 frameNumber; + guint32 SN : 10; + guint32 channelType : 2; + guint32 channelId: 5; + guint32 direction: 1; } rlc_result_hash_key; /* Compare 2 rlc_result_hash_key structs */ diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c index 1a94feded1..62c11b786f 100644 --- a/epan/dissectors/packet-ssl-utils.c +++ b/epan/dissectors/packet-ssl-utils.c @@ -3945,7 +3945,7 @@ ssl_print_string(const gchar* name, const StringInfo* data) /* checks for SSL and DTLS UAT key list fields */ gboolean -ssldecrypt_uat_fld_ip_chk_cb(void* r _U_, const char* p, unsigned len _U_, const void* u1 _U_, const void* u2 _U_, const char** err) +ssldecrypt_uat_fld_ip_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, const char** err) { if (!p || strlen(p) == 0u) { *err = ep_strdup_printf("No IP address given."); @@ -3957,7 +3957,7 @@ ssldecrypt_uat_fld_ip_chk_cb(void* r _U_, const char* p, unsigned len _U_, const } gboolean -ssldecrypt_uat_fld_port_chk_cb(void* r _U_, const char* p, unsigned len _U_, const void* u1 _U_, const void* u2 _U_, const char** err) +ssldecrypt_uat_fld_port_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, const char** err) { if (!p || strlen(p) == 0u) { *err = ep_strdup_printf("No Port given."); @@ -3977,7 +3977,7 @@ ssldecrypt_uat_fld_port_chk_cb(void* r _U_, const char* p, unsigned len _U_, con } gboolean -ssldecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, unsigned len _U_, const void* u1 _U_, const void* u2 _U_, const char** err) +ssldecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, const char** err) { if (!p || strlen(p) == 0u) { *err = ep_strdup_printf("No protocol given."); @@ -3994,7 +3994,7 @@ ssldecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, unsigned len _U_, } gboolean -ssldecrypt_uat_fld_fileopen_chk_cb(void* r _U_, const char* p, unsigned len _U_, const void* u1 _U_, const void* u2 _U_, const char** err) +ssldecrypt_uat_fld_fileopen_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, const char** err) { ws_statb64 st; @@ -4013,7 +4013,7 @@ ssldecrypt_uat_fld_fileopen_chk_cb(void* r _U_, const char* p, unsigned len _U_, } gboolean -ssldecrypt_uat_fld_password_chk_cb(void* r _U_, const char* p, unsigned len _U_, const void* u1 _U_, const void* u2 _U_, const char ** err) +ssldecrypt_uat_fld_password_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, const char ** err) { ssldecrypt_assoc_t* f = r; FILE *fp = NULL; diff --git a/epan/dissectors/packet-teredo.c b/epan/dissectors/packet-teredo.c index 145931de94..0325fc7a7c 100644 --- a/epan/dissectors/packet-teredo.c +++ b/epan/dissectors/packet-teredo.c @@ -83,7 +83,7 @@ static int parse_teredo_auth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, e_teredohdr *teredoh) { - unsigned idlen, aulen; + guint idlen, aulen; if (check_col(pinfo->cinfo, COL_INFO)) col_append_sep_str (pinfo->cinfo, COL_INFO, ", ", diff --git a/epan/dissectors/packet-vicp.c b/epan/dissectors/packet-vicp.c index 21ccb0e7c4..2fe44ed9f8 100644 --- a/epan/dissectors/packet-vicp.c +++ b/epan/dissectors/packet-vicp.c @@ -48,7 +48,7 @@ static void dissect_vicp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *vicp_tree; ptvcursor_t* cursor; - unsigned len; + guint len; if (tvb_reported_length_remaining(tvb, 0) < 8) { diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c index edf9f180f3..0f488bf77e 100644 --- a/epan/dissectors/packet-x11.c +++ b/epan/dissectors/packet-x11.c @@ -1353,7 +1353,7 @@ static guint32 add_boolean(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf) static void colorFlags(tvbuff_t *tvb, int *offsetp, proto_tree *t) { - unsigned do_red_green_blue = VALUE8(tvb, *offsetp); + guint do_red_green_blue = VALUE8(tvb, *offsetp); proto_item *ti; proto_tree *tt; @@ -1541,7 +1541,7 @@ static void listOfColorItem(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf, while(length--) { proto_item *tti; proto_tree *ttt; - unsigned do_red_green_blue; + guint do_red_green_blue; guint16 red, green, blue; emem_strbuf_t *buffer; const char *sep; @@ -2026,7 +2026,7 @@ static void listOfRectangle(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf, proto_tree *tt = proto_item_add_subtree(ti, ett_x11_list_of_rectangle); while(length--) { gint16 x, y; - unsigned width, height; + guint width, height; proto_item *tti; proto_tree *ttt; @@ -2099,7 +2099,7 @@ static void listOfString8(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf, tt = proto_item_add_subtree(ti, ett_x11_list_of_string8); while(length--) { - unsigned l = VALUE8(tvb, *offsetp); + guint l = VALUE8(tvb, *offsetp); s = tvb_get_ephemeral_string(tvb, *offsetp + 1, l); proto_tree_add_string_format(tt, hf_item, tvb, *offsetp, l + 1, s, "\"%s\"", s); *offsetp += l + 1; @@ -2108,7 +2108,7 @@ static void listOfString8(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf, #define STRING16_MAX_DISPLAYED_LENGTH 150 -static int stringIsActuallyAn8BitString(tvbuff_t *tvb, int offset, unsigned length) +static int stringIsActuallyAn8BitString(tvbuff_t *tvb, int offset, guint length) { if (length > STRING16_MAX_DISPLAYED_LENGTH) length = STRING16_MAX_DISPLAYED_LENGTH; for(; length > 0; offset += 2, length--) { @@ -2122,11 +2122,11 @@ static int stringIsActuallyAn8BitString(tvbuff_t *tvb, int offset, unsigned leng static void string16_with_buffer_preallocated(tvbuff_t *tvb, proto_tree *t, int hf, int hf_bytes, - int offset, unsigned length, + int offset, guint length, char **s, guint byte_order) { int truncated = FALSE; - unsigned l = length / 2; + guint l = length / 2; if (stringIsActuallyAn8BitString(tvb, offset, l)) { char *dp; @@ -2186,7 +2186,7 @@ static void listOfTextItem(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf, tt = proto_item_add_subtree(ti, ett_x11_list_of_text_item); while(n--) { - unsigned l = VALUE8(tvb, *offsetp); + guint l = VALUE8(tvb, *offsetp); if (l == 255) { /* Item is a font */ fid = tvb_get_ntohl(tvb, *offsetp + 1); proto_tree_add_uint(tt, hf_x11_textitem_font, tvb, *offsetp, 5, fid); @@ -2464,7 +2464,7 @@ static void setOfPointerEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t, } static void string8(tvbuff_t *tvb, int *offsetp, proto_tree *t, - int hf, unsigned length) + int hf, guint length) { proto_tree_add_item(t, hf, tvb, *offsetp, length, ENC_NA|ENC_ASCII); *offsetp += length; @@ -2473,7 +2473,7 @@ static void string8(tvbuff_t *tvb, int *offsetp, proto_tree *t, /* The length is the length of the _byte_zone_ (twice the length of the string) */ static void string16(tvbuff_t *tvb, int *offsetp, proto_tree *t, int hf, - int hf_bytes, unsigned length, guint byte_order) + int hf_bytes, guint length, guint byte_order) { char *s = NULL; diff --git a/epan/tcap-persistentdata.c b/epan/tcap-persistentdata.c index d886869a5b..189504b33c 100644 --- a/epan/tcap-persistentdata.c +++ b/epan/tcap-persistentdata.c @@ -139,10 +139,10 @@ guint32 tcapsrt_global_SessionId=1; #ifdef DEBUG_TCAPSRT #include <stdio.h> #include <stdarg.h> -static unsigned debug_level = 99; +static guint debug_level = 99; static void -dbg(unsigned level, char* fmt, ...) +dbg(guint level, char* fmt, ...) { va_list ap; diff --git a/epan/uat.c b/epan/uat.c index 9c9ff8ba53..e4b5ba235a 100644 --- a/epan/uat.c +++ b/epan/uat.c @@ -389,7 +389,7 @@ void uat_load_all(void) { } -gboolean uat_fld_chk_str(void* u1 _U_, const char* strptr, unsigned len _U_, const void* u2 _U_, const void* u3 _U_, const char** err) { +gboolean uat_fld_chk_str(void* u1 _U_, const char* strptr, guint len _U_, const void* u2 _U_, const void* u3 _U_, const char** err) { if (strptr == NULL) { *err = "NULL pointer"; return FALSE; @@ -399,7 +399,7 @@ gboolean uat_fld_chk_str(void* u1 _U_, const char* strptr, unsigned len _U_, con return TRUE; } -gboolean uat_fld_chk_oid(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) { +gboolean uat_fld_chk_oid(void* u1 _U_, const char* strptr, guint len, const void* u2 _U_, const void* u3 _U_, const char** err) { unsigned int i; *err = NULL; @@ -425,7 +425,7 @@ gboolean uat_fld_chk_oid(void* u1 _U_, const char* strptr, unsigned len, const v return *err == NULL; } -gboolean uat_fld_chk_proto(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) { +gboolean uat_fld_chk_proto(void* u1 _U_, const char* strptr, guint len, const void* u2 _U_, const void* u3 _U_, const char** err) { if (len) { char* name = ep_strndup(strptr,len); ascii_strdown_inplace(name); @@ -444,7 +444,7 @@ gboolean uat_fld_chk_proto(void* u1 _U_, const char* strptr, unsigned len, const } } -gboolean uat_fld_chk_num_dec(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) { +gboolean uat_fld_chk_num_dec(void* u1 _U_, const char* strptr, guint len, const void* u2 _U_, const void* u3 _U_, const char** err) { if (len > 0) { char* str = ep_strndup(strptr,len); long i = strtol(str,&str,10); @@ -459,7 +459,7 @@ gboolean uat_fld_chk_num_dec(void* u1 _U_, const char* strptr, unsigned len, con return TRUE; } -gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) { +gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, guint len, const void* u2 _U_, const void* u3 _U_, const char** err) { if (len > 0) { char* str = ep_strndup(strptr,len); long i = strtol(str,&str,16); @@ -474,7 +474,7 @@ gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, unsigned len, con return TRUE; } -gboolean uat_fld_chk_enum(void* u1 _U_, const char* strptr, unsigned len, const void* v, const void* u3 _U_, const char** err) { +gboolean uat_fld_chk_enum(void* u1 _U_, const char* strptr, guint len, const void* v, const void* u3 _U_, const char** err) { char* str = ep_strndup(strptr,len); guint i; const value_string* vs = v; @@ -490,7 +490,7 @@ gboolean uat_fld_chk_enum(void* u1 _U_, const char* strptr, unsigned len, const return FALSE; } -gboolean uat_fld_chk_range(void* u1 _U_, const char* strptr, unsigned len, const void* v _U_, const void* u3, const char** err) { +gboolean uat_fld_chk_range(void* u1 _U_, const char* strptr, guint len, const void* v _U_, const void* u3, const char** err) { char* str = ep_strndup(strptr,len); range_t* r = NULL; convert_ret_t ret = range_convert_str(&r, str,GPOINTER_TO_UINT(u3)); diff --git a/epan/uat.h b/epan/uat.h index e401b8e1f0..6a50aeb3d8 100644 --- a/epan/uat.h +++ b/epan/uat.h @@ -331,7 +331,7 @@ CHK_STR_IS_DECL(isdigit); CHK_STR_IS_DECL(isxdigit); #define CHK_STR_IS_DEF(what) \ -gboolean uat_fld_chk_str_ ## what (void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) { \ +gboolean uat_fld_chk_str_ ## what (void* u1 _U_, const char* strptr, guint len, const void* u2 _U_, const void* u3 _U_, const char** err) { \ guint i; for (i=0;i<len;i++) { \ char c = strptr[i]; \ if (! what((int)c)) { \ @@ -350,7 +350,7 @@ gboolean uat_fld_chk_str_ ## what (void* u1 _U_, const char* strptr, unsigned le * a simple c-string contained in (((rec_t*)rec)->(field_name)) */ #define UAT_CSTRING_CB_DEF(basename,field_name,rec_t) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* u1 _U_, const void* u2 _U_) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* u1 _U_, const void* u2 _U_) {\ char* new_buf = g_strndup(buf,len); \ g_free((((rec_t*)rec)->field_name)); \ (((rec_t*)rec)->field_name) = new_buf; } \ @@ -398,7 +398,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out * LSTRING MACROS */ #define UAT_LSTRING_CB_DEF(basename,field_name,rec_t,ptr_element,len_element) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* u1 _U_, const void* u2 _U_) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* u1 _U_, const void* u2 _U_) {\ char* new_val = uat_unesc(buf,len,&(((rec_t*)rec)->len_element)); \ g_free((((rec_t*)rec)->ptr_element)); \ (((rec_t*)rec)->ptr_element) = new_val; }\ @@ -420,7 +420,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out * XXX: UNTESTED and probably BROKEN */ #define UAT_BUFFER_CB_DEF(basename,field_name,rec_t,ptr_element,len_element) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* u1 _U_, const void* u2 _U_) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* u1 _U_, const void* u2 _U_) {\ char* new_buf = len ? g_memdup(buf,len) : NULL; \ g_free((((rec_t*)rec)->ptr_element)); \ (((rec_t*)rec)->ptr_element) = new_buf; \ @@ -438,7 +438,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out * a decimal number contained in */ #define UAT_DEC_CB_DEF(basename,field_name,rec_t) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* u1 _U_, const void* u2 _U_) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* u1 _U_, const void* u2 _U_) {\ ((rec_t*)rec)->field_name = (guint)strtol(ep_strndup(buf,len),NULL,10); } \ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, const void* u1 _U_, const void* u2 _U_) {\ *out_ptr = ep_strdup_printf("%d",((rec_t*)rec)->field_name); \ @@ -453,7 +453,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out * an hexadecimal number contained in */ #define UAT_HEX_CB_DEF(basename,field_name,rec_t) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* u1 _U_, const void* u2 _U_) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* u1 _U_, const void* u2 _U_) {\ ((rec_t*)rec)->field_name = (guint)strtol(ep_strndup(buf,len),NULL,16); } \ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, const void* u1 _U_, const void* u2 _U_) {\ *out_ptr = ep_strdup_printf("%x",((rec_t*)rec)->field_name); \ @@ -471,7 +471,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out * value */ #define UAT_VS_DEF(basename,field_name,rec_t,default_val,default_str) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* vs, const void* u2 _U_) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* vs, const void* u2 _U_) {\ guint i; \ char* str = ep_strndup(buf,len); \ const char* cstr; ((rec_t*)rec)->field_name = default_val; \ @@ -488,7 +488,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out *out_len = (unsigned)strlen(*out_ptr); return; } } } #define UAT_VS_CSTRING_DEF(basename,field_name,rec_t,default_val,default_str) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* vs, const void* u2 _U_) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* vs, const void* u2 _U_) {\ guint i; \ char* str = ep_strndup(buf,len); \ const char* cstr; ((rec_t*)rec)->field_name = default_val; \ @@ -511,7 +511,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out */ #define UAT_PROTO_DEF(basename, field_name, dissector_field, name_field, rec_t) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* u1 _U_, const void* u2 _U_) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* u1 _U_, const void* u2 _U_) {\ if (len) { \ gchar *tmp = g_strndup(buf,len); \ ((rec_t*)rec)->name_field = g_ascii_strdown(tmp, -1); \ @@ -538,7 +538,7 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out */ #define UAT_RANGE_CB_DEF(basename,field_name,rec_t) \ -static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* u1 _U_, const void* u2) {\ +static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* u1 _U_, const void* u2) {\ char* rng = ep_strndup(buf,len);\ range_convert_str(&(((rec_t*)rec)->field_name), rng,GPOINTER_TO_UINT(u2)); \ } \ diff --git a/plugins/irda/irda-appl.h b/plugins/irda/irda-appl.h index a7aa63ae9b..354aba3c18 100644 --- a/plugins/irda/irda-appl.h +++ b/plugins/irda/irda-appl.h @@ -50,8 +50,8 @@ typedef enum { DATA_PDU } pdu_type_t; -typedef gboolean (*ias_value_dissector_t)(tvbuff_t* tvb, unsigned offset, packet_info* pinfo, proto_tree* tree, - unsigned list_index, guint8 attr_type); +typedef gboolean (*ias_value_dissector_t)(tvbuff_t* tvb, guint offset, packet_info* pinfo, proto_tree* tree, + guint list_index, guint8 attr_type); typedef const struct ias_attr_dissector { const char* attr_name; @@ -64,14 +64,14 @@ typedef const struct ias_class_dissector { } ias_class_dissector_t; -extern gboolean check_iap_octet_result(tvbuff_t* tvb, proto_tree* tree, unsigned offset, +extern gboolean check_iap_octet_result(tvbuff_t* tvb, proto_tree* tree, guint offset, const char* attr_name, guint8 attr_type); -extern guint8 check_iap_lsap_result(tvbuff_t* tvb, proto_tree* tree, unsigned offset, +extern guint8 check_iap_lsap_result(tvbuff_t* tvb, proto_tree* tree, guint offset, const char* attr_name, guint8 attr_type); extern void add_lmp_conversation(packet_info* pinfo, guint8 dlsap, gboolean ttp, dissector_t proto_dissector); -extern unsigned dissect_param_tuple(tvbuff_t* tvb, proto_tree* tree, unsigned offset); +extern unsigned dissect_param_tuple(tvbuff_t* tvb, proto_tree* tree, guint offset); /* * Protocol exports. diff --git a/plugins/irda/packet-ircomm.c b/plugins/irda/packet-ircomm.c index 2939b79b97..f0921671e6 100644 --- a/plugins/irda/packet-ircomm.c +++ b/plugins/irda/packet-ircomm.c @@ -135,12 +135,12 @@ static int hf_param_pv = -1; static int hf_control = -1; static int hf_control_len = -1; -static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned offset, packet_info* pinfo, - proto_tree* tree, unsigned list_index, guint8 attr_type); -static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, unsigned offset, packet_info* pinfo, - proto_tree* tree, unsigned list_index, guint8 attr_type); -static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, unsigned offset, packet_info* pinfo, - proto_tree* tree, unsigned list_index, guint8 attr_type); +static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, guint offset, packet_info* pinfo, + proto_tree* tree, guint list_index, guint8 attr_type); +static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, guint offset, packet_info* pinfo, + proto_tree* tree, guint list_index, guint8 attr_type); +static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, guint offset, packet_info* pinfo, + proto_tree* tree, guint list_index, guint8 attr_type); ias_attr_dissector_t ircomm_attr_dissector[] = { /* IrDA:IrCOMM attribute dissectors */ @@ -162,10 +162,10 @@ ias_attr_dissector_t irlpt_attr_dissector[] = { */ static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) { - unsigned offset = 0; - unsigned clen; + guint offset = 0; + guint clen; char buf[128]; - unsigned len; + guint len; if (tvb_length(tvb) == 0) @@ -215,7 +215,7 @@ static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* */ static void dissect_raw_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) { - unsigned len = tvb_length(tvb); + guint len = tvb_length(tvb); char buf[128]; if (len == 0) @@ -241,11 +241,11 @@ static void dissect_raw_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro /* * Dissect IrCOMM IAS "Parameters" attribute */ -static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned offset, packet_info* pinfo _U_, - proto_tree* tree, unsigned list_index, guint8 attr_type) +static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, guint offset, packet_info* pinfo _U_, + proto_tree* tree, guint list_index, guint8 attr_type) { - unsigned len; - unsigned n = 0; + guint len; + guint n = 0; proto_item* ti; proto_tree* p_tree; char buf[256]; @@ -331,8 +331,8 @@ static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned offset, packet /* * Dissect IrCOMM IAS "IrDA:TinyTP:LsapSel" attribute */ -static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, unsigned offset, packet_info* pinfo, - proto_tree* tree, unsigned list_index _U_, guint8 attr_type) +static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, guint offset, packet_info* pinfo, + proto_tree* tree, guint list_index _U_, guint8 attr_type) { guint8 dlsap; @@ -349,8 +349,8 @@ static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, unsigned offset, packet_i /* * Dissect IrCOMM/IrLPT IAS "IrDA:IrLMP:LsapSel" attribute */ -static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, unsigned offset, packet_info* pinfo, - proto_tree* tree, unsigned list_index _U_, guint8 attr_type) +static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, guint offset, packet_info* pinfo, + proto_tree* tree, guint list_index _U_, guint8 attr_type) { guint8 dlsap; @@ -369,7 +369,7 @@ static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, unsigned offset, packet_i */ void proto_register_ircomm(void) { - unsigned i; + guint i; /* Setup list of header fields */ static hf_register_info hf_ircomm[] = { diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c index 4c7e459ce3..d89c64bce8 100644 --- a/plugins/irda/packet-irda.c +++ b/plugins/irda/packet-irda.c @@ -427,7 +427,7 @@ static ias_class_dissector_t class_dissector[] = { CLASS_DISSECTORS }; /* * Dissect parameter tuple */ -unsigned dissect_param_tuple(tvbuff_t* tvb, proto_tree* tree, unsigned offset) +guint dissect_param_tuple(tvbuff_t* tvb, proto_tree* tree, guint offset) { guint8 len = tvb_get_guint8(tvb, offset + 1); @@ -453,9 +453,9 @@ unsigned dissect_param_tuple(tvbuff_t* tvb, proto_tree* tree, unsigned offset) /* * Dissect TTP */ -static unsigned dissect_ttp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, gboolean data) +static guint dissect_ttp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, gboolean data) { - unsigned offset = 0; + guint offset = 0; guint8 head; char buf[128]; @@ -502,7 +502,7 @@ static unsigned dissect_ttp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, */ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) { - unsigned offset = 0; + guint offset = 0; guint8 op; guint8 clen = 0; guint8 alen = 0; @@ -654,10 +654,10 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r */ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) { - unsigned offset = 0; - unsigned len = tvb_length(tvb); - unsigned n = 0; - unsigned list_len; + guint offset = 0; + guint len = tvb_length(tvb); + guint n = 0; + guint list_len; guint8 op; guint8 retcode; guint8 type; @@ -907,7 +907,7 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro /* * Check if IAP result is octet sequence */ -gboolean check_iap_octet_result(tvbuff_t* tvb, proto_tree* tree, unsigned offset, +gboolean check_iap_octet_result(tvbuff_t* tvb, proto_tree* tree, guint offset, const char* attr_name, guint8 attr_type) { if (attr_type != IAS_OCT_SEQ) @@ -929,7 +929,7 @@ gboolean check_iap_octet_result(tvbuff_t* tvb, proto_tree* tree, unsigned offset /* * Check if IAP result is correct LsapSel */ -guint8 check_iap_lsap_result(tvbuff_t* tvb, proto_tree* tree, unsigned offset, +guint8 check_iap_lsap_result(tvbuff_t* tvb, proto_tree* tree, guint offset, const char* attr_name, guint8 attr_type) { guint32 lsap; @@ -957,7 +957,7 @@ guint8 check_iap_lsap_result(tvbuff_t* tvb, proto_tree* tree, unsigned offset, */ static void dissect_appl_proto(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, pdu_type_t pdu_type) { - unsigned offset = 0; + guint offset = 0; guint8 src; address srcaddr; address destaddr; @@ -1027,7 +1027,7 @@ static void dissect_appl_proto(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro */ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) { - unsigned offset = 0; + guint offset = 0; guint8 dlsap; guint8 slsap; guint8 cbit; @@ -1250,9 +1250,9 @@ void add_lmp_conversation(packet_info* pinfo, guint8 dlsap, gboolean ttp, dissec /* * Dissect Negotiation Parameters */ -static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned offset) +static guint dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, guint offset) { - unsigned n = 0; + guint n = 0; proto_item* ti; proto_tree* p_tree; char buf[256]; @@ -1527,7 +1527,7 @@ static void dissect_xid(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, pro if (tvb_reported_length_remaining(tvb, offset) > 0) { - unsigned hints_len; + guint hints_len; guint8 hint1 = 0; guint8 hint2 = 0; char buf[23]; @@ -1879,7 +1879,7 @@ static void dissect_irda(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) */ void proto_register_irda(void) { - unsigned i; + guint i; /* Setup list of header fields */ static hf_register_info hf_lap[] = { diff --git a/plugins/irda/packet-sir.c b/plugins/irda/packet-sir.c index 26819edd97..8813ec73b5 100644 --- a/plugins/irda/packet-sir.c +++ b/plugins/irda/packet-sir.c @@ -148,7 +148,7 @@ dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root) data_offset, eof_offset - data_offset, -1); next_tvb = unescape_data(next_tvb, pinfo); if (root) { - unsigned data_len = tvb_length(next_tvb) < 2 ? 0 : + guint data_len = tvb_length(next_tvb) < 2 ? 0 : tvb_length(next_tvb) - 2; proto_tree* ti = proto_tree_add_protocol_format(root, proto_sir, tvb, offset, eof_offset - offset + 1, diff --git a/plugins/wimaxasncp/wimaxasncp_dict.h b/plugins/wimaxasncp/wimaxasncp_dict.h index 9cd1b96f3e..bf7b6e74c9 100644 --- a/plugins/wimaxasncp/wimaxasncp_dict.h +++ b/plugins/wimaxasncp/wimaxasncp_dict.h @@ -75,7 +75,7 @@ enum struct _wimaxasncp_dict_namecode_t { gchar *name; - unsigned code; + guint code; struct _wimaxasncp_dict_namecode_t *next; }; @@ -115,7 +115,7 @@ int main(int argc, char** argv) { char errbuf[PCAP_ERRBUF_SIZE]; char* interface = NULL; char* outfile = NULL; - unsigned snaplen = 65536; + guint snaplen = 65536; char* start_filter_str = NULL; char* stop_filter_str = NULL; char* capture_filter_str = NULL; diff --git a/ui/gtk/capture_if_details_dlg_win32.c b/ui/gtk/capture_if_details_dlg_win32.c index 6f6988e2dc..9a5de12a83 100644 --- a/ui/gtk/capture_if_details_dlg_win32.c +++ b/ui/gtk/capture_if_details_dlg_win32.c @@ -1088,7 +1088,7 @@ capture_if_details_802_11_bssid_list(GtkWidget *main_vb, struct ndis_bssid_list int len = bssid_item->ie_length; unsigned char *iep = bssid_item->ies; unsigned char id; - unsigned el_len; + guint el_len; NDIS_802_11_FIXED_IEs *fixed_ies; /*#define DEBUG_IE*/ #ifdef DEBUG_IE diff --git a/ui/gtk/conversations_table.c b/ui/gtk/conversations_table.c index f003a2591c..564375ff47 100644 --- a/ui/gtk/conversations_table.c +++ b/ui/gtk/conversations_table.c @@ -2192,7 +2192,7 @@ csv_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter, csv_t *csv = (csv_t *)data; gchar *table_text; int i; - unsigned idx; + guint idx; conv_t *conv; double duration_s; guint64 value; diff --git a/ui/gtk/funnel_stat.c b/ui/gtk/funnel_stat.c index 6ec836aec4..da0547afbd 100644 --- a/ui/gtk/funnel_stat.c +++ b/ui/gtk/funnel_stat.c @@ -96,7 +96,7 @@ static void text_window_cancel_button_cb(GtkWidget *bt _U_, gpointer data) { static void unref_text_win_cancel_bt_cb(GtkWidget *bt _U_, gpointer data) { funnel_text_window_t* tw = data; - unsigned i; + guint i; window_destroy(GTK_WIDGET(tw->win)); tw->win = NULL; @@ -117,7 +117,7 @@ static void unref_text_win_cancel_bt_cb(GtkWidget *bt _U_, gpointer data) { static gboolean text_window_unref_del_event_cb(GtkWidget *win _U_, GdkEvent *event _U_, gpointer user_data) { funnel_text_window_t* tw = user_data; - unsigned i; + guint i; window_destroy(GTK_WIDGET(tw->win)); tw->win = NULL; @@ -320,7 +320,7 @@ static void text_window_destroy(funnel_text_window_t* tw) { g_signal_connect(tw->bt_close, "clicked", G_CALLBACK(unref_text_win_cancel_bt_cb), tw); g_signal_connect(tw->win, "delete-event", G_CALLBACK(text_window_unref_del_event_cb), tw); } else { - unsigned i; + guint i; /* * we have no window anymore a human user closed * the window already just free the container diff --git a/ui/gtk/hostlist_table.c b/ui/gtk/hostlist_table.c index 9c7ed95246..f5582b8312 100644 --- a/ui/gtk/hostlist_table.c +++ b/ui/gtk/hostlist_table.c @@ -835,7 +835,7 @@ csv_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter, csv_t *csv = (csv_t *)data; gchar *table_text; int i; - unsigned idx; + guint idx; guint64 value; gtk_tree_model_get(model, iter, INDEX_COLUMN, &idx, -1); diff --git a/ui/gtk/tcp_graph.c b/ui/gtk/tcp_graph.c index f89ec98ded..906d09bc1b 100644 --- a/ui/gtk/tcp_graph.c +++ b/ui/gtk/tcp_graph.c @@ -586,7 +586,7 @@ static char helptext[] = #if 0 static void debug_coord (struct graph *g, const char *c) { - static unsigned count = 0; + static guint count = 0; count++; printf("%u: %s\n", count, c); diff --git a/ui/gtk/uat_gui.c b/ui/gtk/uat_gui.c index 880f67fcf9..4d27a057b8 100644 --- a/ui/gtk/uat_gui.c +++ b/ui/gtk/uat_gui.c @@ -99,7 +99,7 @@ struct _uat_rep_t { struct _str_pair { const char* ptr; - unsigned len; + guint len; }; struct _uat_dlg_data { @@ -226,7 +226,7 @@ static guint8* unhexbytes(const char* si, guint len, guint* len_p, const char** guint8* buf; guint8* p; const guint8* s = (void*)si; - unsigned i; + guint i; if (len % 2) { *err = ep_strdup_printf("Uneven number of chars hex string %u \n'%s'",len, si); @@ -293,7 +293,7 @@ static gboolean uat_dlg_cb(GtkWidget *win _U_, gpointer user_data) { void* e = g_ptr_array_index(dd->entries,colnum); const char *text = NULL; char *text_free = NULL; - unsigned len = 0; + guint len = 0; switch(f[colnum].mode) { case PT_TXTMOD_FILENAME: diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c index 4cb2c36eff..45b8f8f3cc 100644 --- a/wiretap/file_wrappers.c +++ b/wiretap/file_wrappers.c @@ -109,12 +109,12 @@ struct wtap_reader { int fd; /* file descriptor */ gint64 raw_pos; /* current position in file (just to not call lseek()) */ gint64 pos; /* current position in uncompressed data */ - unsigned size; /* buffer size */ + guint size; /* buffer size */ unsigned char *in; /* input buffer */ unsigned char *out; /* output buffer (double-sized when reading) */ unsigned char *next; /* next output data to deliver or write */ - unsigned have; /* amount of output data unused at next */ + guint have; /* amount of output data unused at next */ int eof; /* true if end of input file reached */ gint64 start; /* where the gzip data started, for rewinding */ gint64 raw; /* where the raw data started, for seeking */ @@ -148,7 +148,7 @@ struct wtap_reader { #endif static int /* gz_load */ -raw_read(FILE_T state, unsigned char *buf, unsigned int count, unsigned *have) +raw_read(FILE_T state, unsigned char *buf, unsigned int count, guint *have) { ssize_t ret; @@ -176,7 +176,7 @@ fill_in_buffer(FILE_T state) if (state->err) return -1; if (state->eof == 0) { - if (raw_read(state, state->in, state->size, (unsigned *)&(state->avail_in)) == -1) + if (raw_read(state, state->in, state->size, (guint *)&(state->avail_in)) == -1) return -1; state->next_in = state->in; } @@ -513,7 +513,7 @@ zlib_read(FILE_T state, unsigned char *buf, unsigned int count) unsigned int ready = count2 - strm->avail_out; if (ready < ZLIB_WINSIZE) { - unsigned left = ZLIB_WINSIZE - cur->pos; + guint left = ZLIB_WINSIZE - cur->pos; if (ready >= left) { memcpy(cur->window + cur->pos, buf2, left); @@ -729,7 +729,7 @@ fill_out_buffer(FILE_T state) static int gz_skip(FILE_T state, gint64 len) { - unsigned n; + guint n; /* skip over len bytes or reach end-of-file, whichever comes first */ while (len) @@ -913,7 +913,7 @@ gint64 file_seek(FILE_T file, gint64 offset, int whence, int *err) { struct fast_seek_point *here; - unsigned n; + guint n; /* can only seek from start or relative to current position */ if (whence != SEEK_SET && whence != SEEK_CUR) { @@ -937,7 +937,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err) * To squelch compiler warnings, we cast the * result. */ - unsigned had = (unsigned)(file->next - file->out); + guint had = (unsigned)(file->next - file->out); if (-offset <= had) { /* * Offset is negative, so -offset is @@ -951,7 +951,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err) * would want, so we cast -offset * instead.) */ - unsigned adjustment = (unsigned)(-offset); + guint adjustment = (unsigned)(-offset); file->have += adjustment; file->next -= adjustment; file->pos -= adjustment; @@ -1140,7 +1140,7 @@ file_iscompressed(FILE_T stream) int file_read(void *buf, unsigned int len, FILE_T file) { - unsigned got, n; + guint got, n; /* if len is zero, avoid unnecessary operations */ if (len == 0) @@ -1219,7 +1219,7 @@ file_getc(FILE_T file) char * file_gets(char *buf, int len, FILE_T file) { - unsigned left, n; + guint left, n; char *str; unsigned char *eol; @@ -1364,8 +1364,8 @@ file_close(FILE_T file) struct wtap_writer { int fd; /* file descriptor */ gint64 pos; /* current position in uncompressed data */ - unsigned size; /* buffer size, zero if not allocated yet */ - unsigned want; /* requested buffer size, default is GZBUFSIZE */ + guint size; /* buffer size, zero if not allocated yet */ + guint want; /* requested buffer size, default is GZBUFSIZE */ unsigned char *in; /* input buffer */ unsigned char *out; /* output buffer (double-sized when reading) */ unsigned char *next; /* next output data to deliver or write */ @@ -1534,10 +1534,10 @@ gz_comp(GZWFILE_T state, int flush) failure or on an attempt to write 0 bytes (in which case state->err is Z_OK); return the number of bytes written on success. */ unsigned -gzwfile_write(GZWFILE_T state, const void *buf, unsigned len) +gzwfile_write(GZWFILE_T state, const void *buf, guint len) { - unsigned put = len; - unsigned n; + guint put = len; + guint n; z_streamp strm; strm = &(state->strm); diff --git a/wiretap/file_wrappers.h b/wiretap/file_wrappers.h index e95f857fe5..fcc320599b 100644 --- a/wiretap/file_wrappers.h +++ b/wiretap/file_wrappers.h @@ -51,7 +51,7 @@ typedef struct wtap_writer *GZWFILE_T; extern GZWFILE_T gzwfile_open(const char *path); extern GZWFILE_T gzwfile_fdopen(int fd); -extern unsigned gzwfile_write(GZWFILE_T state, const void *buf, unsigned len); +extern guint gzwfile_write(GZWFILE_T state, const void *buf, guint len); extern int gzwfile_flush(GZWFILE_T state); extern int gzwfile_close(GZWFILE_T state); extern int gzwfile_geterr(GZWFILE_T state); diff --git a/wiretap/mpeg.c b/wiretap/mpeg.c index dfb8dd6846..17db40ba8a 100644 --- a/wiretap/mpeg.c +++ b/wiretap/mpeg.c @@ -178,9 +178,9 @@ mpeg_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset) (bytes >> 43 & 0x0007) << 30 | (bytes >> 27 & 0x7fff) << 15 | (bytes >> 11 & 0x7fff) << 0; - unsigned ext = (unsigned)((bytes >> 1) & 0x1ff); + guint ext = (guint)((bytes >> 1) & 0x1ff); guint64 cr = 300 * ts_val + ext; - unsigned rem = (unsigned)(cr % SCRHZ); + guint rem = (guint)(cr % SCRHZ); mpeg->now.secs = mpeg->t0 + (time_t)(cr / SCRHZ); mpeg->now.nsecs diff --git a/wiretap/visual.c b/wiretap/visual.c index 1c35a35ad0..33fe043f7d 100644 --- a/wiretap/visual.c +++ b/wiretap/visual.c @@ -151,7 +151,7 @@ struct visual_read_info /* Additional information for writing Visual files */ struct visual_write_info { - unsigned start_time; /* Capture start time in seconds */ + guint start_time; /* Capture start time in seconds */ int index_table_index; /* Index of the next index entry */ int index_table_size; /* Allocated size of the index table */ guint32 * index_table; /* File offsets for the packets */ @@ -702,7 +702,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, struct visual_write_info * visual = (struct visual_write_info *)wdh->priv; struct visual_pkt_hdr vpkt_hdr; size_t hdr_size = sizeof vpkt_hdr; - unsigned delta_msec; + guint delta_msec; guint32 packet_status; /* If the visual structure was never allocated then nothing useful diff --git a/wsutil/mpeg-audio.c b/wsutil/mpeg-audio.c index e6deac9a5e..e848ce673e 100644 --- a/wsutil/mpeg-audio.c +++ b/wsutil/mpeg-audio.c @@ -27,13 +27,13 @@ static const int mpa_versions[4] = { 2, -1, 1, 0 }; static const int mpa_layers[4] = { -1, 2, 1, 0 }; -static const unsigned mpa_samples_data[3][3] = { +static const unsigned int mpa_samples_data[3][3] = { { 384, 1152, 1152 }, { 384, 1152, 576 }, { 384, 1152, 576 }, }; -static const unsigned mpa_bitrates[3][3][16] = { /* kb/s */ +static const unsigned int mpa_bitrates[3][3][16] = { /* kb/s */ { { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 }, { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 }, @@ -51,13 +51,13 @@ static const unsigned mpa_bitrates[3][3][16] = { /* kb/s */ }, }; -static const unsigned mpa_frequencies[3][4] = { +static const unsigned int mpa_frequencies[3][4] = { { 44100, 48000, 32000 }, { 22050, 24000, 16000 }, { 11025, 12000, 8000 }, }; -static const unsigned mpa_padding_data[3] = { 4, 1, 1 }; +static const unsigned int mpa_padding_data[3] = { 4, 1, 1 }; int mpa_version(const struct mpa *mpa) diff --git a/wsutil/mpeg-audio.h b/wsutil/mpeg-audio.h index 2f6194cc6b..23ee3465da 100644 --- a/wsutil/mpeg-audio.h +++ b/wsutil/mpeg-audio.h @@ -26,19 +26,19 @@ #define MPA_H 1 struct mpa { - unsigned emphasis :2; - unsigned original :1; - unsigned copyright :1; - unsigned modeext :2; - unsigned mode :2; - unsigned private :1; - unsigned padding :1; - unsigned frequency :2; - unsigned bitrate :4; - unsigned protection :1; - unsigned layer :2; - unsigned version :2; - unsigned sync :11; + unsigned int emphasis :2; + unsigned int original :1; + unsigned int copyright :1; + unsigned int modeext :2; + unsigned int mode :2; + unsigned int private :1; + unsigned int padding :1; + unsigned int frequency :2; + unsigned int bitrate :4; + unsigned int protection :1; + unsigned int layer :2; + unsigned int version :2; + unsigned int sync :11; }; #define MPA_UNMARSHAL_SYNC(n) ((n) >> 21 & 0x7ff) @@ -73,10 +73,10 @@ struct mpa { int mpa_version(const struct mpa *); int mpa_layer(const struct mpa *); -unsigned mpa_samples(const struct mpa *); -unsigned mpa_bitrate(const struct mpa *); -unsigned mpa_frequency(const struct mpa *); -unsigned mpa_padding(const struct mpa *); +unsigned int mpa_samples(const struct mpa *); +unsigned int mpa_bitrate(const struct mpa *); +unsigned int mpa_frequency(const struct mpa *); +unsigned int mpa_padding(const struct mpa *); #define MPA_DATA_BYTES(mpa) (mpa_bitrate(mpa) * mpa_samples(mpa) \ / mpa_frequency(mpa) / 8) |