mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-24 10:57:53 +02:00
include string.h
2001-02-17 Havoc Pennington <hp@pobox.com> * gthread.c: include string.h Applied patch from Soeren Sandmann: * testglib.c: const fixes * gwin32.h: format cleanups * gutils.c (g_atexit): constify a variable (g_find_program_in_path): constification (g_basename): G_CONST_RETURN (g_path_skip_root): G_CONST_RETURN (g_getenv): G_CONST_RETURN (g_get_user_name): G_CONST_RETURN (g_get_real_name): G_CONST_RETURN (g_get_home_dir): G_CONST_RETURN (g_get_tmp_dir): G_CONST_RETURN (g_get_prgname): G_CONST_RETURN (_glib_gettext): G_CONST_RETURN * gunicode.h: formatting cleanups * gstrfuncs.c (g_strerror): G_CONST_RETURN (g_strsignal): G_CONST_RETURN * gspawn.c (g_execute): const on variables * gmessages.c (printf_string_upper_bound): fix const on a variable * gmem.c (g_mem_chunk_new): make the "name" arg const (struct _GRealMemChunk): make the "name" field const * gfileutils.c (g_file_open_tmp): store const return in a const gchar* variable * gdataset.c (g_quark_to_string): G_CONST_RETURN 2001-02-17 Havoc Pennington <hp@pobox.com> Applied patch from Soeren Sandmann: * gvaluetypes.c (g_value_get_string): G_CONST_RETURN * gtype.c (g_type_name): G_CONST_RETURN * gsignal.c (g_signal_name): G_CONST_RETURN * gobject-query.c (main): const fix 2001-02-17 Havoc Pennington <hp@pobox.com> Applied patch from Soeren Sandmann: * gmodule.c (g_module_error): G_CONST_RETURN (g_module_name): G_CONST_RETURN
This commit is contained in:
committed by
Havoc Pennington
parent
adfafc0872
commit
1c391cc698
@@ -111,7 +111,7 @@ void
|
||||
g_atexit (GVoidFunc func)
|
||||
{
|
||||
gint result;
|
||||
gchar *error = NULL;
|
||||
const gchar *error = NULL;
|
||||
|
||||
/* keep this in sync with glib.h */
|
||||
|
||||
@@ -171,7 +171,8 @@ my_strchrnul (const gchar *str, gchar c)
|
||||
gchar*
|
||||
g_find_program_in_path (const gchar *program)
|
||||
{
|
||||
gchar *path, *p, *name, *freeme;
|
||||
const gchar *path, *p;
|
||||
gchar *name, *freeme;
|
||||
size_t len;
|
||||
size_t pathlen;
|
||||
|
||||
@@ -373,7 +374,7 @@ g_parse_debug_string (const gchar *string,
|
||||
return result;
|
||||
}
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_basename (const gchar *file_name)
|
||||
{
|
||||
register gchar *base;
|
||||
@@ -465,8 +466,8 @@ g_path_is_absolute (const gchar *file_name)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gchar*
|
||||
g_path_skip_root (gchar *file_name)
|
||||
G_CONST_RETURN gchar*
|
||||
g_path_skip_root (const gchar *file_name)
|
||||
{
|
||||
g_return_val_if_fail (file_name != NULL, NULL);
|
||||
|
||||
@@ -490,7 +491,7 @@ g_path_skip_root (gchar *file_name)
|
||||
if (file_name[0] == G_DIR_SEPARATOR)
|
||||
file_name++;
|
||||
|
||||
return file_name;
|
||||
return (gchar *)file_name;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -500,13 +501,13 @@ g_path_skip_root (gchar *file_name)
|
||||
{
|
||||
while (file_name[0] == G_DIR_SEPARATOR)
|
||||
file_name++;
|
||||
return file_name;
|
||||
return (gchar *)file_name;
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
/* Skip X:\ */
|
||||
if (isalpha (file_name[0]) && file_name[1] == ':' && file_name[2] == G_DIR_SEPARATOR)
|
||||
return file_name + 3;
|
||||
return (gchar *)file_name + 3;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
@@ -597,7 +598,7 @@ g_get_current_dir (void)
|
||||
return dir;
|
||||
}
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_getenv (const gchar *variable)
|
||||
{
|
||||
#ifndef G_OS_WIN32
|
||||
@@ -864,7 +865,7 @@ g_get_any_init (void)
|
||||
}
|
||||
}
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_get_user_name (void)
|
||||
{
|
||||
G_LOCK (g_utils_global);
|
||||
@@ -875,7 +876,7 @@ g_get_user_name (void)
|
||||
return g_user_name;
|
||||
}
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_get_real_name (void)
|
||||
{
|
||||
G_LOCK (g_utils_global);
|
||||
@@ -892,7 +893,7 @@ g_get_real_name (void)
|
||||
* deduced, return NULL.
|
||||
*/
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_get_home_dir (void)
|
||||
{
|
||||
G_LOCK (g_utils_global);
|
||||
@@ -910,7 +911,7 @@ g_get_home_dir (void)
|
||||
* and C:\ on Windows.
|
||||
*/
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_get_tmp_dir (void)
|
||||
{
|
||||
G_LOCK (g_utils_global);
|
||||
@@ -1014,7 +1015,7 @@ g_get_codeset (void)
|
||||
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
gchar *
|
||||
G_CONST_RETURN gchar *
|
||||
_glib_gettext (const gchar *str)
|
||||
{
|
||||
gboolean _glib_gettext_initialized = FALSE;
|
||||
|
Reference in New Issue
Block a user