parent
cd7c20c9d9
commit
b10d4714e1
|
@ -58,7 +58,7 @@ bytes_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied)
|
|||
/* Free up the old value, if we have one */
|
||||
bytes_fvalue_free(fv);
|
||||
|
||||
fv->value.bytes = value;
|
||||
fv->value.bytes = (GByteArray *)value;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -147,7 +147,7 @@ static void
|
|||
ether_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied)
|
||||
{
|
||||
g_assert(!already_copied);
|
||||
common_fvalue_set(fv, value, FT_ETHER_LEN);
|
||||
common_fvalue_set(fv, (guint8*)value, FT_ETHER_LEN);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -158,7 +158,7 @@ oid_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied)
|
|||
/* Free up the old value, if we have one */
|
||||
bytes_fvalue_free(fv);
|
||||
|
||||
fv->value.bytes = value;
|
||||
fv->value.bytes = (GByteArray *)value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -445,13 +445,13 @@ cmp_matches(fvalue_t *fv_a, fvalue_t *fv_b)
|
|||
return FALSE;
|
||||
}
|
||||
return g_regex_match_full(
|
||||
regex, /* Compiled PCRE */
|
||||
a->data, /* The data to check for the pattern... */
|
||||
regex, /* Compiled PCRE */
|
||||
a->data, /* The data to check for the pattern... */
|
||||
(int)a->len, /* ... and its length */
|
||||
0, /* Start offset within data */
|
||||
0, /* GRegexMatchFlags */
|
||||
NULL, /* We are not interested in the match information */
|
||||
NULL /* We don't want error information */
|
||||
0, /* Start offset within data */
|
||||
0, /* GRegexMatchFlags */
|
||||
NULL, /* We are not interested in the match information */
|
||||
NULL /* We don't want error information */
|
||||
);
|
||||
/* NOTE - DO NOT g_free(data) */
|
||||
}
|
||||
|
@ -461,28 +461,28 @@ ftype_register_bytes(void)
|
|||
{
|
||||
|
||||
static ftype_t bytes_type = {
|
||||
FT_BYTES, /* ftype */
|
||||
"FT_BYTES", /* name */
|
||||
FT_BYTES, /* ftype */
|
||||
"FT_BYTES", /* name */
|
||||
"Sequence of bytes", /* pretty_name */
|
||||
0, /* wire_size */
|
||||
bytes_fvalue_new, /* new_value */
|
||||
bytes_fvalue_free, /* free_value */
|
||||
0, /* wire_size */
|
||||
bytes_fvalue_new, /* new_value */
|
||||
bytes_fvalue_free, /* free_value */
|
||||
bytes_from_unparsed, /* val_from_unparsed */
|
||||
bytes_from_string, /* val_from_string */
|
||||
bytes_to_repr, /* val_to_string_repr */
|
||||
bytes_repr_len, /* len_string_repr */
|
||||
bytes_from_string, /* val_from_string */
|
||||
bytes_to_repr, /* val_to_string_repr */
|
||||
bytes_repr_len, /* len_string_repr */
|
||||
|
||||
bytes_fvalue_set, /* set_value */
|
||||
NULL, /* set_value_uinteger */
|
||||
NULL, /* set_value_sinteger */
|
||||
NULL, /* set_value_integer64 */
|
||||
NULL, /* set_value_floating */
|
||||
bytes_fvalue_set, /* set_value */
|
||||
NULL, /* set_value_uinteger */
|
||||
NULL, /* set_value_sinteger */
|
||||
NULL, /* set_value_integer64 */
|
||||
NULL, /* set_value_floating */
|
||||
|
||||
value_get, /* get_value */
|
||||
NULL, /* get_value_uinteger */
|
||||
NULL, /* get_value_sinteger */
|
||||
NULL, /* get_value_integer64 */
|
||||
NULL, /* get_value_floating */
|
||||
value_get, /* get_value */
|
||||
NULL, /* get_value_uinteger */
|
||||
NULL, /* get_value_sinteger */
|
||||
NULL, /* get_value_integer64 */
|
||||
NULL, /* get_value_floating */
|
||||
|
||||
cmp_eq,
|
||||
cmp_ne,
|
||||
|
|
|
@ -636,7 +636,7 @@ eui64_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
|
|||
static void
|
||||
eui64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
|
||||
{
|
||||
guint8 *p_eui64 = ep_alloc(8);
|
||||
guint8 *p_eui64 = (guint8 *)ep_alloc(8);
|
||||
|
||||
/* Copy and convert the address to network byte order. */
|
||||
*(guint64 *)(void *)(p_eui64) = pntoh64(&(fv->value.integer64));
|
||||
|
|
|
@ -145,7 +145,7 @@ gregex_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied)
|
|||
/* Free up the old value, if we have one */
|
||||
gregex_fvalue_free(fv);
|
||||
g_assert(! already_copied);
|
||||
val_from_unparsed(fv, value, FALSE, NULL);
|
||||
val_from_unparsed(fv, (char *)value, FALSE, NULL);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
|
|
|
@ -53,7 +53,7 @@ string_fvalue_set(fvalue_t *fv, gpointer value, gboolean already_copied)
|
|||
/* Free up the old value, if we have one */
|
||||
string_fvalue_free(fv);
|
||||
|
||||
fv->value.string = g_strdup(value);
|
||||
fv->value.string = (gchar *)g_strdup(value);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -163,7 +163,7 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu
|
|||
* in the middle of the byte string? */
|
||||
int num_bytes = fv_bytes->value.bytes->len;
|
||||
|
||||
fv->value.string = g_malloc(num_bytes + 1);
|
||||
fv->value.string = (gchar *)g_malloc(num_bytes + 1);
|
||||
memcpy(fv->value.string, fv_bytes->value.bytes->data, num_bytes);
|
||||
fv->value.string[num_bytes] = '\0';
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ value_set(fvalue_t *fv, gpointer value, gboolean already_copied)
|
|||
/* Free up the old value, if we have one */
|
||||
value_free(fv);
|
||||
|
||||
fv->value.tvb = value;
|
||||
fv->value.tvb = (tvbuff_t *)value;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -75,7 +75,7 @@ val_from_string(fvalue_t *fv, char *s, LogFunc logfunc _U_)
|
|||
|
||||
/* Make a tvbuff from the string. We can drop the
|
||||
* terminating NUL. */
|
||||
private_data = g_memdup(s, (guint)strlen(s));
|
||||
private_data = (guint8 *)g_memdup(s, (guint)strlen(s));
|
||||
new_tvb = tvb_new_real_data(private_data,
|
||||
(guint)strlen(s), (gint)strlen(s));
|
||||
|
||||
|
@ -102,7 +102,7 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu
|
|||
fv_bytes = fvalue_from_unparsed(FT_BYTES, s, TRUE, NULL);
|
||||
if (fv_bytes) {
|
||||
/* Make a tvbuff from the bytes */
|
||||
private_data = g_memdup(fv_bytes->value.bytes->data,
|
||||
private_data = (guint8 *)g_memdup(fv_bytes->value.bytes->data,
|
||||
fv_bytes->value.bytes->len);
|
||||
new_tvb = tvb_new_real_data(private_data,
|
||||
fv_bytes->value.bytes->len,
|
||||
|
|
|
@ -205,7 +205,7 @@ fvalue_new(ftenum_t ftype)
|
|||
ftype_t *ft;
|
||||
FvalueNewFunc new_value;
|
||||
|
||||
fv = sl_alloc(&fvalue_t_slab);
|
||||
fv = (fvalue_t *)sl_alloc(&fvalue_t_slab);
|
||||
|
||||
FTYPE_LOOKUP(ftype, ft);
|
||||
fv->ftype = ft;
|
||||
|
@ -307,7 +307,7 @@ fvalue_to_string_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
|
|||
if (!buf) {
|
||||
int len;
|
||||
if ((len = fvalue_string_repr_len(fv, rtype)) >= 0) {
|
||||
buf = g_malloc0(len + 1);
|
||||
buf = (char *)g_malloc0(len + 1);
|
||||
} else {
|
||||
/* the value cannot be represented in the given representation type (rtype) */
|
||||
return NULL;
|
||||
|
@ -326,8 +326,8 @@ typedef struct {
|
|||
static void
|
||||
slice_func(gpointer data, gpointer user_data)
|
||||
{
|
||||
drange_node *drnode = data;
|
||||
slice_data_t *slice_data = user_data;
|
||||
drange_node *drnode = (drange_node *)data;
|
||||
slice_data_t *slice_data = (slice_data_t *)user_data;
|
||||
gint start_offset;
|
||||
gint length = 0;
|
||||
gint end_offset = 0;
|
||||
|
|
Loading…
Reference in New Issue