This time eliminate a few instances of the code initializing struct tok
with negative values and squelch the warnings like below:
warning: initializer will be sign-extended: -1
#define GO_NXT_ILV(ilv,rlen) ((rlen) -= F_ALN_LEN(EXTRACT_32BITS(&(ilv)->length)), \
(struct forces_ilv *)(((char*)(ilv)) \
+ F_ALN_LEN(EXTRACT_32BITS(&(ilv)->length))))
#define GO_NXT_ILV(ilv,rlen) ((rlen) -= F_ALN_LEN(EXTRACT_32BITS(&(ilv)->length)), \
(struct forces_ilv *)(((char*)(ilv)) \
+ F_ALN_LEN(EXTRACT_32BITS(&(ilv)->length))))
-#define INVALID_RLEN -1
-#define INVALID_STLN -2
-#define INVALID_LTLN -3
-#define INVALID_ALEN -4
+#define INVALID_RLEN 1
+#define INVALID_STLN 2
+#define INVALID_LTLN 3
+#define INVALID_ALEN 4
static const struct tok ForCES_TLV_err[] = {
{INVALID_RLEN, "Invalid total length"},
static const struct tok ForCES_TLV_err[] = {
{INVALID_RLEN, "Invalid total length"},
-static inline int tlv_valid(const struct forces_tlv *tlv, u_int rlen)
+static inline u_int tlv_valid(const struct forces_tlv *tlv, u_int rlen)
{
if (rlen < TLV_HDRL)
return INVALID_RLEN;
{
if (rlen < TLV_HDRL)
return INVALID_RLEN;
u_int32_t id;
char *ib = indent_pr(indent, 0);
u_int16_t type, tll;
u_int32_t id;
char *ib = indent_pr(indent, 0);
u_int16_t type, tll;
TCHECK(*tdp);
id = EXTRACT_32BITS(tdp);
TCHECK(*tdp);
id = EXTRACT_32BITS(tdp);
u_int16_t tll;
int pad = 0;
u_int aln;
u_int16_t tll;
int pad = 0;
u_int aln;
TCHECK(*pdtlv);
type = EXTRACT_16BITS(&pdtlv->type);
TCHECK(*pdtlv);
type = EXTRACT_16BITS(&pdtlv->type);
const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr;
u_int16_t type;
int tll;
const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr;
u_int16_t type;
int tll;
char *ib = indent_pr(indent, 0);
TCHECK(*pdtlv);
char *ib = indent_pr(indent, 0);
TCHECK(*pdtlv);
{
const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr;
int tll;
{
const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr;
int tll;
u_int16_t type;
register const u_char *dp;
char *ib;
u_int16_t type;
register const u_char *dp;
char *ib;
const struct forces_tlv *tlv = (struct forces_tlv *)pptr;
u_int dlen;
u_int rlen;
const struct forces_tlv *tlv = (struct forces_tlv *)pptr;
u_int dlen;
u_int rlen;
/*
* forces_type_print() has ensured that len (the TLV length)
/*
* forces_type_print() has ensured that len (the TLV length)
char *ib = indent_pr(indent, 0);
u_int dlen;
u_int rlen;
char *ib = indent_pr(indent, 0);
u_int dlen;
u_int rlen;
/*
* forces_type_print() has ensured that len (the TLV length)
/*
* forces_type_print() has ensured that len (the TLV length)
{
const struct forces_tlv *tltlv;
u_int rlen;
{
const struct forces_tlv *tltlv;
u_int rlen;
int rc = 0;
int ttlv = 0;
int rc = 0;
int ttlv = 0;
{ 110, "volume busy" },
{ 111, "volume moved" },
{ 112, "AFS IO error" },
{ 110, "volume busy" },
{ 111, "volume moved" },
{ 112, "AFS IO error" },
- { -100, "restarting fileserver" },
+ { 0xffffff9c, "restarting fileserver" }, /* -100, sic! */