From Maynard, Chris :

The attached patches, generated via  svn diff , correct various compiler 

& lint warnings, among them: 

 

lemon.c(2582) : warning C4090: '=' : different 'const' qualifiers

packet-ber.c(212) : warning C4018: '<=' : signed/unsigned mismatch

packet-ber.c(228) : warning C4018: '>=' : signed/unsigned mismatch

packet-bootp.c(2112) : warning C4018: '<' : signed/unsigned mismatch

packet-iscsi.c(801) : warning C4018: '>=' : signed/unsigned mismatch


svn path=/trunk/; revision=15085
This commit is contained in:
Anders Broman 2005-07-26 09:52:06 +00:00
parent d410c9ed54
commit 9c99a261f0
6 changed files with 71 additions and 70 deletions

View File

@ -36,10 +36,10 @@
# include "snprintf.h"
#endif
#include <string.h>
/* #include <string.h> */
#include <glib.h>
#include <epan/packet.h>
#include <epan/strutil.h>
/* #include <epan/strutil.h> */
#include <epan/conversation.h>
#include "packet-afp.h"
@ -735,7 +735,7 @@ static const value_string map_id_type_vals[] = {
#define AR_U_WRITE (1 << 26) /* user has write access */
#define AR_BLANK (1 << 28) /* Blank Access Privileges (use parent dir privileges) */
#define AR_U_OWN (1 << 31) /* user is the owner */
#define AR_U_OWN (1UL << 31) /* user is the owner */
static int hf_afp_dir_ar = -1;
static int hf_afp_dir_ar_o_search = -1;
@ -1326,7 +1326,7 @@ parse_UTF8_filename(proto_tree *tree, tvbuff_t *tvb, gint offset, gint org_offse
static gint
parse_file_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap, int shared)
{
guint16 snameoff = 0;
/* guint16 snameoff = 0; */
gint max_offset = 0;
gint org_offset = offset;
@ -1365,7 +1365,7 @@ parse_file_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap,
}
if ((bitmap & kFPShortNameBit)) {
snameoff = tvb_get_ntohs(tvb, offset);
/* snameoff = tvb_get_ntohs(tvb, offset); */
proto_tree_add_item(tree, hf_afp_short_name_offset,tvb, offset, 2, FALSE);
offset += 2;
}
@ -1484,7 +1484,7 @@ decode_dir_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset)
static gint
parse_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap)
{
guint16 snameoff = 0;
/* guint16 snameoff = 0; */
gint max_offset = 0;
gint org_offset = offset;
@ -1522,7 +1522,7 @@ parse_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap)
offset += 2;
}
if ((bitmap & kFPShortNameBit)) {
snameoff = tvb_get_ntohs(tvb, offset);
/* snameoff = tvb_get_ntohs(tvb, offset); */
proto_tree_add_item(tree, hf_afp_short_name_offset,tvb, offset, 2, FALSE);
offset += 2;
}
@ -2206,7 +2206,7 @@ query_catsearch(tvbuff_t *tvb, proto_tree *ptree, gint offset, int ext)
offset += 2;
r_bitmap = tvb_get_ntohl(tvb, offset);
if (ptree) {
/* Already checked this above: if (ptree) */ {
item = proto_tree_add_item(ptree, hf_afp_file_bitmap, tvb, offset, 4,FALSE);
sub_tree = proto_item_add_subtree(item, ett_afp_cat_r_bitmap);
@ -3426,10 +3426,12 @@ int size;
/* FIXME spec and capture disagree : or it's 4 bytes with no token type, or it's 2 bytes */
size = 4;
/* [cm]: FIXME continued: Since size is set to 4, this test is never true.
if (size == 2) {
proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2,FALSE);
offset += 2;
}
*/
len = tvb_get_ntohl(tvb, offset);
proto_tree_add_item(tree, hf_afp_session_token_len, tvb, offset, size,FALSE);
offset += size;
@ -4219,7 +4221,6 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_query_afp_set_acl(tvb, pinfo, afp_tree, offset);break;
case AFP_ACCESS:
offset = dissect_query_afp_access(tvb, pinfo, afp_tree, offset);break;
break;
}
}
else {
@ -5782,7 +5783,7 @@ proto_register_afp(void)
proto_register_field_array(proto_afp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine( &afp_reinit);
register_init_routine(afp_reinit);
register_dissector("afp", dissect_afp, proto_afp);
data_handle = find_dissector("data");

View File

@ -26,55 +26,55 @@
#define PACKET_AFP_H
#define AFP_OK 0
#define AFPERR_ACCESS -5000 /* permission denied */
#define AFPERR_AUTHCONT -5001 /* logincont */
#define AFPERR_BADUAM -5002 /* uam doesn't exist */
#define AFPERR_BADVERS -5003 /* bad afp version number */
#define AFPERR_BITMAP -5004 /* invalid bitmap */
#define AFPERR_CANTMOVE -5005 /* can't move file */
#define AFPERR_DENYCONF -5006 /* file synchronization locks conflict */
#define AFPERR_DIRNEMPT -5007 /* directory not empty */
#define AFPERR_DFULL -5008 /* disk full */
#define AFPERR_EOF -5009 /* end of file -- catsearch and afp_read */
#define AFPERR_BUSY -5010 /* FileBusy */
#define AFPERR_FLATVOL -5011 /* volume doesn't support directories */
#define AFPERR_NOITEM -5012 /* ItemNotFound */
#define AFPERR_LOCK -5013 /* LockErr */
#define AFPERR_MISC -5014 /* misc. err */
#define AFPERR_NLOCK -5015 /* no more locks */
#define AFPERR_NOSRVR -5016 /* no response by server at that address */
#define AFPERR_EXIST -5017 /* object already exists */
#define AFPERR_NOOBJ -5018 /* object not found */
#define AFPERR_PARAM -5019 /* parameter error */
#define AFPERR_NORANGE -5020 /* no range lock */
#define AFPERR_RANGEOVR -5021 /* range overlap */
#define AFPERR_SESSCLOS -5022 /* session closed */
#define AFPERR_NOTAUTH -5023 /* user not authenticated */
#define AFPERR_NOOP -5024 /* command not supported */
#define AFPERR_BADTYPE -5025 /* object is the wrong type */
#define AFPERR_NFILE -5026 /* too many files open */
#define AFPERR_SHUTDOWN -5027 /* server is going down */
#define AFPERR_NORENAME -5028 /* can't rename */
#define AFPERR_NODIR -5029 /* couldn't find directory */
#define AFPERR_ITYPE -5030 /* wrong icon type */
#define AFPERR_VLOCK -5031 /* volume locked */
#define AFPERR_OLOCK -5032 /* object locked */
#define AFPERR_CTNSHRD -5033 /* share point contains a share point */
#define AFPERR_NOID -5034 /* file thread not found */
#define AFPERR_EXISTID -5035 /* file already has an id */
#define AFPERR_DIFFVOL -5036 /* different volume */
#define AFPERR_CATCHNG -5037 /* catalog has changed */
#define AFPERR_SAMEOBJ -5038 /* source file == destination file */
#define AFPERR_BADID -5039 /* non-existent file id */
#define AFPERR_PWDSAME -5040 /* same password/can't change password */
#define AFPERR_PWDSHORT -5041 /* password too short */
#define AFPERR_PWDEXPR -5042 /* password expired */
#define AFPERR_INSHRD -5043 /* folder being shared is inside a shared folder. may be returned by
#define AFPERR_ACCESS (-5000) /* permission denied */
#define AFPERR_AUTHCONT (-5001) /* logincont */
#define AFPERR_BADUAM (-5002) /* uam doesn't exist */
#define AFPERR_BADVERS (-5003) /* bad afp version number */
#define AFPERR_BITMAP (-5004) /* invalid bitmap */
#define AFPERR_CANTMOVE (-5005) /* can't move file */
#define AFPERR_DENYCONF (-5006) /* file synchronization locks conflict */
#define AFPERR_DIRNEMPT (-5007) /* directory not empty */
#define AFPERR_DFULL (-5008) /* disk full */
#define AFPERR_EOF (-5009) /* end of file -- catsearch and afp_read */
#define AFPERR_BUSY (-5010) /* FileBusy */
#define AFPERR_FLATVOL (-5011) /* volume doesn't support directories */
#define AFPERR_NOITEM (-5012) /* ItemNotFound */
#define AFPERR_LOCK (-5013) /* LockErr */
#define AFPERR_MISC (-5014) /* misc. err */
#define AFPERR_NLOCK (-5015) /* no more locks */
#define AFPERR_NOSRVR (-5016) /* no response by server at that address */
#define AFPERR_EXIST (-5017) /* object already exists */
#define AFPERR_NOOBJ (-5018) /* object not found */
#define AFPERR_PARAM (-5019) /* parameter error */
#define AFPERR_NORANGE (-5020) /* no range lock */
#define AFPERR_RANGEOVR (-5021) /* range overlap */
#define AFPERR_SESSCLOS (-5022) /* session closed */
#define AFPERR_NOTAUTH (-5023) /* user not authenticated */
#define AFPERR_NOOP (-5024) /* command not supported */
#define AFPERR_BADTYPE (-5025) /* object is the wrong type */
#define AFPERR_NFILE (-5026) /* too many files open */
#define AFPERR_SHUTDOWN (-5027) /* server is going down */
#define AFPERR_NORENAME (-5028) /* can't rename */
#define AFPERR_NODIR (-5029) /* couldn't find directory */
#define AFPERR_ITYPE (-5030) /* wrong icon type */
#define AFPERR_VLOCK (-5031) /* volume locked */
#define AFPERR_OLOCK (-5032) /* object locked */
#define AFPERR_CTNSHRD (-5033) /* share point contains a share point */
#define AFPERR_NOID (-5034) /* file thread not found */
#define AFPERR_EXISTID (-5035) /* file already has an id */
#define AFPERR_DIFFVOL (-5036) /* different volume */
#define AFPERR_CATCHNG (-5037) /* catalog has changed */
#define AFPERR_SAMEOBJ (-5038) /* source file == destination file */
#define AFPERR_BADID (-5039) /* non-existent file id */
#define AFPERR_PWDSAME (-5040) /* same password/can't change password */
#define AFPERR_PWDSHORT (-5041) /* password too short */
#define AFPERR_PWDEXPR (-5042) /* password expired */
#define AFPERR_INSHRD (-5043) /* folder being shared is inside a shared folder. may be returned by
afpMoveAndRename. */
#define AFPERR_INTRASH -5044 /* shared folder in trash. */
#define AFPERR_PWDCHNG -5045 /* password needs to be changed */
#define AFPERR_PWDPOLCY -5046 /* password fails policy check */
#define AFPERR_USRLOGIN -5047 /* user already logged on */
#define AFPERR_INTRASH (-5044) /* shared folder in trash. */
#define AFPERR_PWDCHNG (-5045) /* password needs to be changed */
#define AFPERR_PWDPOLCY (-5046) /* password fails policy check */
#define AFPERR_USRLOGIN (-5047) /* user already logged on */
extern const value_string asp_error_vals[];
extern const value_string afp_server_addr_type_vals[];

View File

@ -35,7 +35,7 @@
#endif
#include <stdio.h>
#include <stdlib.h>
/* #include <stdlib.h> */
#include <gmodule.h>
#ifdef HAVE_SYS_TYPES_H
@ -183,7 +183,7 @@ static gint ett_params = -1;
static guint32 ansi_637_trans_tele_id;
static char ansi_637_bigbuf[1024];
static gchar ansi_637_add_string[1024];
static dissector_handle_t data_handle;
/* static dissector_handle_t data_handle; */
static dissector_table_t tele_dissector_table;
static packet_info *g_pinfo;
static proto_tree *g_tree;
@ -194,7 +194,7 @@ static void
decode_7_bits(tvbuff_t *tvb, guint32 *offset, guint8 num_fields, guint8 *last_oct, guint8 *last_bit, gchar *buf)
{
guint8 oct, oct2, bit;
guint32 saved_offset;
/* guint32 saved_offset; */
guint32 i;
@ -203,7 +203,7 @@ decode_7_bits(tvbuff_t *tvb, guint32 *offset, guint8 num_fields, guint8 *last_oc
return;
}
saved_offset = *offset;
/* saved_offset = *offset; */
oct = oct2 = *last_oct;
bit = *last_bit;
@ -398,7 +398,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
/* NOTE: there are now 3 bits remaining in 'oct' */
if (len - used <= 0) return;
if (len <= used) return;
/*
* decode rest if 7-bit ASCII
@ -1533,7 +1533,7 @@ dissect_ansi_637_tele_message(tvbuff_t *tvb, proto_tree *ansi_637_tree)
guint8 len;
guint32 octs;
guint32 curr_offset;
guint32 msg_id;
/* guint32 msg_id; */
guint32 msg_type;
const gchar *str = NULL;
proto_item *item;
@ -1554,7 +1554,7 @@ dissect_ansi_637_tele_message(tvbuff_t *tvb, proto_tree *ansi_637_tree)
octs = tvb_get_ntoh24(tvb, 2);
msg_type = (octs >> 20) & 0x0f;
msg_id = (octs >> 4) & 0xffff;
/* msg_id = (octs >> 4) & 0xffff; */
str = match_strval(msg_type, ansi_tele_msg_type_strings);
@ -1912,5 +1912,5 @@ proto_reg_handoff_ansi_637(void)
*/
dissector_add("ansi_a.sms", 0, ansi_637_trans_handle);
data_handle = find_dissector("data");
/* data_handle = find_dissector("data"); */
}

View File

@ -209,7 +209,7 @@ get_ber_length_dont_check_len(proto_tree *tree, tvbuff_t *tvb, int offset, guint
tmp_ind = FALSE;
/* dont read beyond the end of the tvb */
if(tvb_length(tvb)<=offset){
if(tvb_length(tvb)<=(unsigned)offset){
*length=tvb_length(tvb)+99;
return offset;
}
@ -225,7 +225,7 @@ get_ber_length_dont_check_len(proto_tree *tree, tvbuff_t *tvb, int offset, guint
if (len) {
/* 8.1.3.5 */
while (len--) {
if(offset>=tvb_length(tvb)){
if((unsigned)offset>=tvb_length(tvb)){
if (length)
*length = 999999999;
if (ind)

View File

@ -2034,7 +2034,7 @@ dissect_packetcable_mta_cap(proto_tree *v_tree, tvbuff_t *tvb, int voff, int len
unsigned long flow_val = 0;
int off = PKT_MDC_TLV_OFF + voff;
guint tlv_len;
int i;
guint i;
guint8 asc_val[3] = " ", flow_val_str[5];
static GString *tlv_str = NULL;
char bit_fld[64];

View File

@ -798,7 +798,7 @@ handleDataDigest(proto_item *ti, tvbuff_t *tvb, guint offset, int dataLen) {
}
return offset + dataLen + 4;
}
if(available_bytes >= (dataLen + dataDigestSize)) {
if((unsigned)available_bytes >= (dataLen + dataDigestSize)) {
proto_tree_add_item(ti, hf_iscsi_DataDigest, tvb, offset + dataLen, dataDigestSize, FALSE);
}
return offset + dataLen + dataDigestSize;