size_t fixes.

svn path=/trunk/; revision=27984
This commit is contained in:
Gerald Combs 2009-04-07 16:36:52 +00:00
parent 6f92b028aa
commit 6348c17c16
4 changed files with 30 additions and 30 deletions

View File

@ -128,7 +128,7 @@ col_set_fence(column_info *cinfo, gint el)
for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
if (cinfo->fmt_matx[i][el]) {
cinfo->col_fence[i] = strlen(cinfo->col_data[i]);
cinfo->col_fence[i] = (int)strlen(cinfo->col_data[i]);
}
}
}
@ -241,7 +241,7 @@ col_add_fstr(column_info *cinfo, gint el, const gchar *format, ...) {
va_list ap;
int i;
int fence;
size_t max_len;
int max_len;
if (!check_col(cinfo, el))
return;
@ -359,8 +359,8 @@ static void
col_do_append_sep_va_fstr(column_info *cinfo, gint el, const gchar *separator,
const gchar *format, va_list ap)
{
int i;
size_t len, max_len, sep_len;
int i;
int len, max_len, sep_len;
if (el == COL_INFO)
max_len = COL_MAX_INFO_LEN;
@ -370,7 +370,7 @@ col_do_append_sep_va_fstr(column_info *cinfo, gint el, const gchar *separator,
if (separator == NULL)
sep_len = 0;
else
sep_len = strlen(separator);
sep_len = (int) strlen(separator);
for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
if (cinfo->fmt_matx[i][el]) {
/*
@ -378,7 +378,7 @@ col_do_append_sep_va_fstr(column_info *cinfo, gint el, const gchar *separator,
*/
COL_CHECK_APPEND(cinfo, i, max_len);
len = strlen(cinfo->col_buf[i]);
len = (int) strlen(cinfo->col_buf[i]);
/*
* If we have a separator, append it if the column isn't empty.
@ -439,7 +439,7 @@ col_prepend_fstr(column_info *cinfo, gint el, const gchar *format, ...)
int i;
char orig_buf[COL_BUF_MAX_LEN];
const char *orig;
size_t max_len;
int max_len;
if (!check_col(cinfo, el))
return;
@ -466,7 +466,7 @@ col_prepend_fstr(column_info *cinfo, gint el, const gchar *format, ...)
* Move the fence, unless it's at the beginning of the string.
*/
if (cinfo->col_fence[i] > 0)
cinfo->col_fence[i] += strlen(cinfo->col_buf[i]);
cinfo->col_fence[i] += (int) strlen(cinfo->col_buf[i]);
g_strlcat(cinfo->col_buf[i], orig, max_len);
cinfo->col_data[i] = cinfo->col_buf[i];
@ -481,7 +481,7 @@ col_prepend_fence_fstr(column_info *cinfo, gint el, const gchar *format, ...)
int i;
char orig_buf[COL_BUF_MAX_LEN];
const char *orig;
size_t max_len;
int max_len;
if (!check_col(cinfo, el))
return;
@ -509,9 +509,9 @@ col_prepend_fence_fstr(column_info *cinfo, gint el, const gchar *format, ...)
* end of the prepended data.
*/
if (cinfo->col_fence[i] > 0) {
cinfo->col_fence[i] += strlen(cinfo->col_buf[i]);
cinfo->col_fence[i] += (int) strlen(cinfo->col_buf[i]);
} else {
cinfo->col_fence[i] = strlen(cinfo->col_buf[i]);
cinfo->col_fence[i] = (int) strlen(cinfo->col_buf[i]);
}
g_strlcat(cinfo->col_buf[i], orig, max_len);
cinfo->col_data[i] = cinfo->col_buf[i];

View File

@ -612,7 +612,7 @@ get_column_longest_string(gint format)
gint
get_column_char_width(gint format)
{
return strlen(get_column_longest_string(format));
return (gint)strlen(get_column_longest_string(format));
}
gint

View File

@ -328,9 +328,9 @@ emem_create_chunk(emem_chunk_t **free_list) {
ret = VirtualProtect(prot2, pagesize, PAGE_NOACCESS, &oldprot);
g_assert(ret != 0 || versinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
npc->amount_free_init = prot2 - prot1 - pagesize;
npc->amount_free_init = (unsigned int) (prot2 - prot1 - pagesize);
npc->amount_free = npc->amount_free_init;
npc->free_offset_init = (prot1 - npc->buf) + pagesize;
npc->free_offset_init = (unsigned int) (prot1 - npc->buf) + pagesize;
npc->free_offset = npc->free_offset_init;
#elif defined(USE_GUARD_PAGES)
@ -418,8 +418,8 @@ ep_alloc(size_t size)
buf = free_list->buf + free_list->free_offset;
free_list->amount_free -= size;
free_list->free_offset += size;
free_list->amount_free -= (unsigned int) size;
free_list->free_offset += (unsigned int) size;
#ifdef DEBUG_USE_CANARIES
cptr = (char *)buf + size - pad;
@ -492,8 +492,8 @@ se_alloc(size_t size)
buf = free_list->buf + free_list->free_offset;
free_list->amount_free -= size;
free_list->free_offset += size;
free_list->amount_free -= (unsigned int) size;
free_list->free_offset += (unsigned int) size;
#ifdef DEBUG_USE_CANARIES
cptr = (char *)buf + size - pad;
@ -524,7 +524,7 @@ void* ep_alloc0(size_t size) {
}
gchar* ep_strdup(const gchar* src) {
guint len = strlen(src);
guint len = (guint) strlen(src);
gchar* dst;
dst = strncpy(ep_alloc(len+1), src, len);
@ -552,7 +552,7 @@ void* ep_memdup(const void* src, size_t len) {
gchar* ep_strdup_vprintf(const gchar* fmt, va_list ap) {
va_list ap2;
guint len;
gsize len;
gchar* dst;
G_VA_COPY(ap2, ap);
@ -560,7 +560,7 @@ gchar* ep_strdup_vprintf(const gchar* fmt, va_list ap) {
len = g_printf_string_upper_bound(fmt, ap);
dst = ep_alloc(len+1);
g_vsnprintf (dst, len, fmt, ap2);
g_vsnprintf (dst, (gulong) len, fmt, ap2);
va_end(ap2);
return dst;
@ -593,8 +593,8 @@ gchar** ep_strsplit(const gchar* string, const gchar* sep, int max_tokens) {
return NULL;
s = splitted = ep_strdup(string);
str_len = strlen(splitted);
sep_len = strlen(sep);
str_len = (guint) strlen(splitted);
sep_len = (guint) strlen(sep);
if (max_tokens < 1) max_tokens = INT_MAX;
@ -668,7 +668,7 @@ gchar* se_strdup(const gchar* src) {
return "<NULL>";
}
len = strlen(src);
len = (guint) strlen(src);
dst = strncpy(se_alloc(len+1), src, len);
dst[len] = '\0';
@ -694,7 +694,7 @@ void* se_memdup(const void* src, size_t len) {
gchar* se_strdup_vprintf(const gchar* fmt, va_list ap) {
va_list ap2;
guint len;
gsize len;
gchar* dst;
G_VA_COPY(ap2, ap);
@ -702,7 +702,7 @@ gchar* se_strdup_vprintf(const gchar* fmt, va_list ap) {
len = g_printf_string_upper_bound(fmt, ap);
dst = se_alloc(len+1);
g_vsnprintf (dst, len, fmt, ap2);
g_vsnprintf (dst, (gulong) len, fmt, ap2);
va_end(ap2);
return dst;
@ -1473,7 +1473,7 @@ emem_tree_insert_string(emem_tree_t* se_tree, const gchar* k, void* v, guint32 f
{
emem_tree_key_t key[2];
guint32 *aligned=NULL;
guint32 len = strlen(k);
guint32 len = (guint32) strlen(k);
guint32 div = (len+3)/4+1;
guint32 i;
guint32 tmp;
@ -1525,7 +1525,7 @@ emem_tree_lookup_string(emem_tree_t* se_tree, const gchar* k, guint32 flags)
{
emem_tree_key_t key[2];
guint32 *aligned=NULL;
guint32 len = strlen(k);
guint32 len = (guint) strlen(k);
guint32 div = (len+3)/4+1;
guint32 i;
guint32 tmp;
@ -1773,7 +1773,7 @@ ep_strbuf_append_vprintf(emem_strbuf_t *strbuf, const gchar *format, va_list ap)
add_len = strbuf->alloc_len - strbuf->len;
}
full_len = g_vsnprintf(&strbuf->str[strbuf->len], add_len, format, ap2);
full_len = g_vsnprintf(&strbuf->str[strbuf->len], (gulong) add_len, format, ap2);
strbuf->len += MIN(add_len, full_len);
va_end(ap2);

View File

@ -384,7 +384,7 @@ check_fragments( int index, tcp_stream_chunk *sc, gulong acknowledged ) {
*/
dummy_str = g_strdup_printf("[%d bytes missing in capture file]",
(int)(lowest_seq - seq[index]) );
sc->dlen = strlen(dummy_str);
sc->dlen = (guint32) strlen(dummy_str);
write_packet_data( index, sc, dummy_str );
g_free(dummy_str);
seq[index] = lowest_seq;