summaryrefslogtreecommitdiff
path: root/epan/strutil.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-03-18 21:16:23 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-03-18 21:16:23 +0000
commit55c498169dfc04c1539f8a659113c8f30e53862d (patch)
tree1749e181d23ec9a28c3a98c7d3294ff9b270d54c /epan/strutil.c
parent84241f46ada962c7b4b9b3cf0f1be134ee99b00c (diff)
downloadwireshark-55c498169dfc04c1539f8a659113c8f30e53862d.tar.gz
From beroset:
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48400
Diffstat (limited to 'epan/strutil.c')
-rw-r--r--epan/strutil.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/epan/strutil.c b/epan/strutil.c
index 36211a3bf9..85b270eb27 100644
--- a/epan/strutil.c
+++ b/epan/strutil.c
@@ -53,7 +53,7 @@ find_line_end(const guchar *data, const guchar *dataend, const guchar **eol)
{
const guchar *lineend;
- lineend = memchr(data, '\n', dataend - data);
+ lineend = (guchar *)memchr(data, '\n', dataend - data);
if (lineend == NULL) {
/*
* No LF - line is probably continued in next TCP segment.
@@ -163,7 +163,7 @@ format_text(const guchar *string, size_t len)
* Allocate the buffer if it's not already allocated.
*/
if (fmtbuf[idx] == NULL) {
- fmtbuf[idx] = g_malloc(INITIAL_FMTBUF_SIZE);
+ fmtbuf[idx] = (gchar *)g_malloc(INITIAL_FMTBUF_SIZE);
fmtbuf_len[idx] = INITIAL_FMTBUF_SIZE;
}
column = 0;
@@ -181,7 +181,7 @@ format_text(const guchar *string, size_t len)
* for one more character plus a terminating '\0'.
*/
fmtbuf_len[idx] = fmtbuf_len[idx] * 2;
- fmtbuf[idx] = g_realloc(fmtbuf[idx], fmtbuf_len[idx]);
+ fmtbuf[idx] = (gchar *)g_realloc(fmtbuf[idx], fmtbuf_len[idx]);
}
c = *string++;
@@ -269,7 +269,7 @@ format_text_wsp(const guchar *string, size_t len)
* Allocate the buffer if it's not already allocated.
*/
if (fmtbuf[idx] == NULL) {
- fmtbuf[idx] = g_malloc(INITIAL_FMTBUF_SIZE);
+ fmtbuf[idx] = (gchar *)g_malloc(INITIAL_FMTBUF_SIZE);
fmtbuf_len[idx] = INITIAL_FMTBUF_SIZE;
}
column = 0;
@@ -287,7 +287,7 @@ format_text_wsp(const guchar *string, size_t len)
* for one more character plus a terminating '\0'.
*/
fmtbuf_len[idx] = fmtbuf_len[idx] * 2;
- fmtbuf[idx] = g_realloc(fmtbuf[idx], fmtbuf_len[idx]);
+ fmtbuf[idx] = (gchar *)g_realloc(fmtbuf[idx], fmtbuf_len[idx]);
}
c = *string++;
@@ -551,7 +551,7 @@ format_uri(const GByteArray *bytes, const gchar *reserved_chars)
* Allocate the buffer if it's not already allocated.
*/
if (fmtbuf[idx] == NULL) {
- fmtbuf[idx] = g_malloc(INITIAL_FMTBUF_SIZE);
+ fmtbuf[idx] = (gchar *)g_malloc(INITIAL_FMTBUF_SIZE);
fmtbuf_len[idx] = INITIAL_FMTBUF_SIZE;
}
for (column = 0; column < bytes->len; column++) {
@@ -568,7 +568,7 @@ format_uri(const GByteArray *bytes, const gchar *reserved_chars)
* for one more character plus a terminating '\0'.
*/
fmtbuf_len[idx] = fmtbuf_len[idx] * 2;
- fmtbuf[idx] = g_realloc(fmtbuf[idx], fmtbuf_len[idx]);
+ fmtbuf[idx] = (gchar *)g_realloc(fmtbuf[idx], fmtbuf_len[idx]);
}
c = bytes->data[column];
@@ -818,7 +818,7 @@ convert_string_to_hex(const char *string, size_t *nbytes)
* OK, it's valid, and it generates "n_bytes" bytes; generate the
* raw byte array.
*/
- bytes = g_malloc(n_bytes);
+ bytes = (guint8 *)g_malloc(n_bytes);
p = &string[0];
q = &bytes[0];
for (;;) {
@@ -1019,7 +1019,7 @@ ws_strdup_escape_char (const gchar *str, const gchar chr)
p = str;
/* Worst case: A string that is full of 'chr' */
- q = new_str = g_malloc (strlen(str) * 2 + 1);
+ q = new_str = (gchar *)g_malloc (strlen(str) * 2 + 1);
while(*p != 0) {
if(*p == chr)
@@ -1047,7 +1047,7 @@ ws_strdup_unescape_char (const gchar *str, const char chr)
p = str;
/* Worst case: A string that contains no 'chr' */
- q = new_str = g_malloc (strlen(str) + 1);
+ q = new_str = (gchar *)g_malloc (strlen(str) + 1);
while(*p != 0) {
*q++ = *p;