mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-20 17:22:11 +01:00
minor code cleanups.
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org> * gstrfuncs.c: minor code cleanups.
This commit is contained in:
parent
ff140aa613
commit
d5a1c85ba6
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gstrfuncs.c: minor code cleanups.
|
||||||
|
|
||||||
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gstrfuncs.c: minor code cleanups.
|
||||||
|
|
||||||
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gstrfuncs.c: minor code cleanups.
|
||||||
|
|
||||||
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gstrfuncs.c: minor code cleanups.
|
||||||
|
|
||||||
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gstrfuncs.c: minor code cleanups.
|
||||||
|
|
||||||
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gstrfuncs.c: minor code cleanups.
|
||||||
|
|
||||||
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gstrfuncs.c: minor code cleanups.
|
||||||
|
|
||||||
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
Thu Apr 29 02:16:36 1999 Tim Janik <timj@gtk.org>
|
||||||
|
|
||||||
|
* gstrfuncs.c: minor code cleanups.
|
||||||
|
|
||||||
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
Tue Apr 27 13:11:29 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
* gmain.c (g_main_poll): Mask out ERR HUP and NVAL from
|
||||||
|
2
glib.h
2
glib.h
@ -702,6 +702,7 @@ typedef struct _GTuples GTuples;
|
|||||||
typedef union _GTokenValue GTokenValue;
|
typedef union _GTokenValue GTokenValue;
|
||||||
typedef struct _GIOChannel GIOChannel;
|
typedef struct _GIOChannel GIOChannel;
|
||||||
|
|
||||||
|
/* Tree traverse flags */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
G_TRAVERSE_LEAFS = 1 << 0,
|
G_TRAVERSE_LEAFS = 1 << 0,
|
||||||
@ -710,6 +711,7 @@ typedef enum
|
|||||||
G_TRAVERSE_MASK = 0x03
|
G_TRAVERSE_MASK = 0x03
|
||||||
} GTraverseFlags;
|
} GTraverseFlags;
|
||||||
|
|
||||||
|
/* Tree traverse orders */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
G_IN_ORDER,
|
G_IN_ORDER,
|
||||||
|
@ -702,6 +702,7 @@ typedef struct _GTuples GTuples;
|
|||||||
typedef union _GTokenValue GTokenValue;
|
typedef union _GTokenValue GTokenValue;
|
||||||
typedef struct _GIOChannel GIOChannel;
|
typedef struct _GIOChannel GIOChannel;
|
||||||
|
|
||||||
|
/* Tree traverse flags */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
G_TRAVERSE_LEAFS = 1 << 0,
|
G_TRAVERSE_LEAFS = 1 << 0,
|
||||||
@ -710,6 +711,7 @@ typedef enum
|
|||||||
G_TRAVERSE_MASK = 0x03
|
G_TRAVERSE_MASK = 0x03
|
||||||
} GTraverseFlags;
|
} GTraverseFlags;
|
||||||
|
|
||||||
|
/* Tree traverse orders */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
G_IN_ORDER,
|
G_IN_ORDER,
|
||||||
|
@ -927,7 +927,7 @@ g_printf_string_upper_bound (const gchar* format,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_strdown (gchar *string)
|
g_strdown (gchar *string)
|
||||||
{
|
{
|
||||||
register gchar *s;
|
register gchar *s;
|
||||||
|
|
||||||
@ -943,7 +943,7 @@ g_strdown (gchar *string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_strup (gchar *string)
|
g_strup (gchar *string)
|
||||||
{
|
{
|
||||||
register gchar *s;
|
register gchar *s;
|
||||||
|
|
||||||
@ -959,7 +959,7 @@ g_strup (gchar *string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_strreverse (gchar *string)
|
g_strreverse (gchar *string)
|
||||||
{
|
{
|
||||||
g_return_if_fail (string != NULL);
|
g_return_if_fail (string != NULL);
|
||||||
|
|
||||||
@ -1208,7 +1208,7 @@ g_strjoinv (const gchar *separator,
|
|||||||
|
|
||||||
g_return_val_if_fail (str_array != NULL, NULL);
|
g_return_val_if_fail (str_array != NULL, NULL);
|
||||||
|
|
||||||
if(separator == NULL)
|
if (separator == NULL)
|
||||||
separator = "";
|
separator = "";
|
||||||
|
|
||||||
if (*str_array)
|
if (*str_array)
|
||||||
@ -1245,42 +1245,47 @@ g_strjoin (const gchar *separator,
|
|||||||
guint len;
|
guint len;
|
||||||
guint separator_len;
|
guint separator_len;
|
||||||
|
|
||||||
if(separator == NULL)
|
if (separator == NULL)
|
||||||
separator = "";
|
separator = "";
|
||||||
|
|
||||||
separator_len = strlen (separator);
|
separator_len = strlen (separator);
|
||||||
|
|
||||||
va_start(args, separator);
|
va_start (args, separator);
|
||||||
|
|
||||||
s = va_arg(args, gchar *);
|
s = va_arg (args, gchar*);
|
||||||
|
|
||||||
if(s) {
|
if (s)
|
||||||
len = strlen(s) + 1;
|
{
|
||||||
|
len = strlen (s);
|
||||||
while((s = va_arg(args, gchar*)))
|
|
||||||
{
|
s = va_arg (args, gchar*);
|
||||||
len += separator_len + strlen(s);
|
while (s)
|
||||||
}
|
{
|
||||||
va_end(args);
|
len += separator_len + strlen (s);
|
||||||
|
s = va_arg (args, gchar*);
|
||||||
string = g_new (gchar, len);
|
}
|
||||||
|
va_end (args);
|
||||||
va_start(args, separator);
|
|
||||||
|
string = g_new (gchar, len + 1);
|
||||||
*string = 0;
|
*string = 0;
|
||||||
s = va_arg(args, gchar*);
|
|
||||||
strcat (string, s);
|
va_start (args, separator);
|
||||||
|
|
||||||
while((s = va_arg(args, gchar*)))
|
s = va_arg (args, gchar*);
|
||||||
{
|
strcat (string, s);
|
||||||
strcat(string, separator);
|
|
||||||
strcat(string, s);
|
s = va_arg (args, gchar*);
|
||||||
}
|
while (s)
|
||||||
|
{
|
||||||
} else
|
strcat (string, separator);
|
||||||
string = g_strdup("");
|
strcat (string, s);
|
||||||
|
s = va_arg (args, gchar*);
|
||||||
va_end(args);
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
string = g_strdup ("");
|
||||||
|
|
||||||
|
va_end (args);
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
73
gstrfuncs.c
73
gstrfuncs.c
@ -927,7 +927,7 @@ g_printf_string_upper_bound (const gchar* format,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_strdown (gchar *string)
|
g_strdown (gchar *string)
|
||||||
{
|
{
|
||||||
register gchar *s;
|
register gchar *s;
|
||||||
|
|
||||||
@ -943,7 +943,7 @@ g_strdown (gchar *string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_strup (gchar *string)
|
g_strup (gchar *string)
|
||||||
{
|
{
|
||||||
register gchar *s;
|
register gchar *s;
|
||||||
|
|
||||||
@ -959,7 +959,7 @@ g_strup (gchar *string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_strreverse (gchar *string)
|
g_strreverse (gchar *string)
|
||||||
{
|
{
|
||||||
g_return_if_fail (string != NULL);
|
g_return_if_fail (string != NULL);
|
||||||
|
|
||||||
@ -1208,7 +1208,7 @@ g_strjoinv (const gchar *separator,
|
|||||||
|
|
||||||
g_return_val_if_fail (str_array != NULL, NULL);
|
g_return_val_if_fail (str_array != NULL, NULL);
|
||||||
|
|
||||||
if(separator == NULL)
|
if (separator == NULL)
|
||||||
separator = "";
|
separator = "";
|
||||||
|
|
||||||
if (*str_array)
|
if (*str_array)
|
||||||
@ -1245,42 +1245,47 @@ g_strjoin (const gchar *separator,
|
|||||||
guint len;
|
guint len;
|
||||||
guint separator_len;
|
guint separator_len;
|
||||||
|
|
||||||
if(separator == NULL)
|
if (separator == NULL)
|
||||||
separator = "";
|
separator = "";
|
||||||
|
|
||||||
separator_len = strlen (separator);
|
separator_len = strlen (separator);
|
||||||
|
|
||||||
va_start(args, separator);
|
va_start (args, separator);
|
||||||
|
|
||||||
s = va_arg(args, gchar *);
|
s = va_arg (args, gchar*);
|
||||||
|
|
||||||
if(s) {
|
if (s)
|
||||||
len = strlen(s) + 1;
|
{
|
||||||
|
len = strlen (s);
|
||||||
while((s = va_arg(args, gchar*)))
|
|
||||||
{
|
s = va_arg (args, gchar*);
|
||||||
len += separator_len + strlen(s);
|
while (s)
|
||||||
}
|
{
|
||||||
va_end(args);
|
len += separator_len + strlen (s);
|
||||||
|
s = va_arg (args, gchar*);
|
||||||
string = g_new (gchar, len);
|
}
|
||||||
|
va_end (args);
|
||||||
va_start(args, separator);
|
|
||||||
|
string = g_new (gchar, len + 1);
|
||||||
*string = 0;
|
*string = 0;
|
||||||
s = va_arg(args, gchar*);
|
|
||||||
strcat (string, s);
|
va_start (args, separator);
|
||||||
|
|
||||||
while((s = va_arg(args, gchar*)))
|
s = va_arg (args, gchar*);
|
||||||
{
|
strcat (string, s);
|
||||||
strcat(string, separator);
|
|
||||||
strcat(string, s);
|
s = va_arg (args, gchar*);
|
||||||
}
|
while (s)
|
||||||
|
{
|
||||||
} else
|
strcat (string, separator);
|
||||||
string = g_strdup("");
|
strcat (string, s);
|
||||||
|
s = va_arg (args, gchar*);
|
||||||
va_end(args);
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
string = g_strdup ("");
|
||||||
|
|
||||||
|
va_end (args);
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user