Get rid of old GLib 1.2[.x] stuff, as we now require GLib 2.x.
svn path=/trunk/; revision=25192
This commit is contained in:
parent
d136d93252
commit
1ad79116ed
|
@ -53,9 +53,7 @@
|
|||
#include "epan/packet.h"
|
||||
#include <epan/prefs.h>
|
||||
|
||||
#if GLIB_MAJOR_VERSION >= 2
|
||||
#include <glib.h>
|
||||
#endif
|
||||
|
||||
#include "packet-gsm_sms.h"
|
||||
|
||||
|
@ -1486,15 +1484,6 @@ gsm_sms_char_7bit_unpack(unsigned int offset, unsigned int in_length, unsigned i
|
|||
#define GN_CHAR_ALPHABET_SIZE 128
|
||||
|
||||
#define GN_CHAR_ESCAPE 0x1b
|
||||
#if GLIB_MAJOR_VERSION < 2
|
||||
typedef unsigned int gunichar;
|
||||
|
||||
int g_unichar_to_utf8(gunichar c, char * outbuf) {
|
||||
*outbuf = (unsigned char) c;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static gunichar gsm_default_alphabet[GN_CHAR_ALPHABET_SIZE] = {
|
||||
|
||||
|
@ -1830,12 +1819,10 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb
|
|||
guint32 out_len;
|
||||
char *ustr;
|
||||
char messagebuf[160];
|
||||
#if GLIB_MAJOR_VERSION >= 2
|
||||
proto_item *ucs2_item;
|
||||
gchar *utf8_text = NULL;
|
||||
GIConv cd;
|
||||
GError *l_conv_error = NULL;
|
||||
#endif
|
||||
|
||||
fill_bits = 0;
|
||||
|
||||
|
@ -1918,7 +1905,6 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb
|
|||
}
|
||||
else if (ucs2)
|
||||
{
|
||||
#if GLIB_MAJOR_VERSION >= 2
|
||||
if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv)-1)
|
||||
{
|
||||
utf8_text = g_convert_with_iconv(tvb->real_data + offset, length , cd , NULL , NULL , &l_conv_error);
|
||||
|
@ -1934,13 +1920,10 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb
|
|||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
/* tvb_get_ephemeral_faked_unicode takes the lengt in number of guint16's */
|
||||
ustr = tvb_get_ephemeral_faked_unicode(tvb, offset, (length>>1), FALSE);
|
||||
proto_tree_add_text(subtree, tvb, offset, length, "%s", ustr);
|
||||
#if GLIB_MAJOR_VERSION >= 2
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,29 +215,4 @@ char * convert_string_case(const char *string, gboolean case_insensitive);
|
|||
*/
|
||||
char * epan_strcasestr(const char *haystack, const char *needle);
|
||||
|
||||
/* g_strlcat() does not exist in GLib 1.2[.x] */
|
||||
#if GLIB_MAJOR_VERSION < 2
|
||||
gsize g_strlcat(gchar *dst, const gchar *src, gsize size);
|
||||
gsize g_strlcpy(gchar *dest, const gchar *src, gsize dest_size);
|
||||
#endif
|
||||
|
||||
#if GLIB_MAJOR_VERSION < 2
|
||||
/* g_ascii_isprint() does not exist in GLib 1.2[.x].
|
||||
* assume all codes >=0x20 and <0x80 are ASCII printables.
|
||||
*/
|
||||
#define g_ascii_isprint(c) \
|
||||
(((c<0x20)||(c>=0x80))?FALSE:TRUE)
|
||||
/* g_ascii_isxdigit() does not exist in Glib 1.2 */
|
||||
#define g_ascii_isxdigit(c) \
|
||||
( ((c>='0')&&(c<='9'))?TRUE: \
|
||||
( ((c>='a')&&(c<='f'))?TRUE: \
|
||||
(((c>='A')&&(c<='F'))?TRUE:FALSE) ) )
|
||||
|
||||
#endif
|
||||
|
||||
#if GLIB_MAJOR_VERSION < 2
|
||||
/* g_byte_array_sized_new() doesnt exist in glib-1.2 */
|
||||
GByteArray *g_byte_array_sized_new(guint reserved_size);
|
||||
#endif
|
||||
|
||||
#endif /* __STRUTIL_H__ */
|
||||
|
|
|
@ -272,15 +272,11 @@ WSLUA_CONSTRUCTOR Dir_open(lua_State* L) {
|
|||
dir->dir = OPENDIR_OP(dirname_clean);
|
||||
g_free(dirname_clean);
|
||||
dir->ext = extension ? g_strdup(extension) : NULL;
|
||||
#if GLIB_MAJOR_VERSION >= 2
|
||||
dir->dummy = g_malloc(sizeof(GError *));
|
||||
*(dir->dummy) = NULL;
|
||||
#endif
|
||||
|
||||
if (dir->dir == NULL) {
|
||||
#if GLIB_MAJOR_VERSION >= 2
|
||||
g_free(dir->dummy);
|
||||
#endif
|
||||
g_free(dir);
|
||||
|
||||
WSLUA_ARG_ERROR(Dir_open,PATHNAME,"could not open directory");
|
||||
|
@ -354,9 +350,7 @@ WSLUA_METAMETHOD wslua_Dir__gc(lua_State* L) {
|
|||
CLOSEDIR_OP(dir->dir);
|
||||
}
|
||||
|
||||
#if GLIB_MAJOR_VERSION >= 2
|
||||
g_free(dir->dummy);
|
||||
#endif
|
||||
|
||||
if (dir->ext) g_free(dir->ext);
|
||||
|
||||
|
|
Loading…
Reference in New Issue