mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +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
@@ -1,3 +1,15 @@
|
||||
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
|
||||
|
||||
Sat Feb 17 07:58:46 2001 Tim Janik <timj@gtk.org>
|
||||
|
||||
* genums.h (G_TYPE_IS_FLAGS): patch from sven to fixup
|
||||
|
@@ -213,7 +213,7 @@ main (gint argc,
|
||||
root = ~0;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
gchar *name = g_type_name (i);
|
||||
const gchar *name = g_type_name (i);
|
||||
|
||||
if (name)
|
||||
show_nodes (i, 0, iindent);
|
||||
|
@@ -813,7 +813,7 @@ g_signal_lookup (const gchar *name,
|
||||
return signal_id;
|
||||
}
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_signal_name (guint signal_id)
|
||||
{
|
||||
SignalNode *node;
|
||||
@@ -873,7 +873,7 @@ g_signal_list_ids (GType itype,
|
||||
for (i = 0; i < n_nodes; i++)
|
||||
if (keys[i].itype == itype)
|
||||
{
|
||||
gchar *name = g_quark_to_string (keys[i].quark);
|
||||
const gchar *name = g_quark_to_string (keys[i].quark);
|
||||
|
||||
/* Signal names with "_" in them are aliases to the same
|
||||
* name with "-" instead of "_".
|
||||
|
@@ -88,55 +88,56 @@ struct _GSignalQuery
|
||||
|
||||
|
||||
/* --- signals --- */
|
||||
guint g_signal_newv (const gchar *signal_name,
|
||||
GType itype,
|
||||
GSignalFlags signal_flags,
|
||||
GClosure *class_closure,
|
||||
GSignalAccumulator accumulator,
|
||||
GSignalCMarshaller c_marshaller,
|
||||
GType return_type,
|
||||
guint n_params,
|
||||
GType *param_types);
|
||||
guint g_signal_new_valist (const gchar *signal_name,
|
||||
GType itype,
|
||||
GSignalFlags signal_flags,
|
||||
GClosure *class_closure,
|
||||
GSignalAccumulator accumulator,
|
||||
GSignalCMarshaller c_marshaller,
|
||||
GType return_type,
|
||||
guint n_params,
|
||||
va_list args);
|
||||
guint g_signal_newc (const gchar *signal_name,
|
||||
GType itype,
|
||||
GSignalFlags signal_flags,
|
||||
guint class_offset,
|
||||
GSignalAccumulator accumulator,
|
||||
GSignalCMarshaller c_marshaller,
|
||||
GType return_type,
|
||||
guint n_params,
|
||||
...);
|
||||
void g_signal_emitv (const GValue *instance_and_params,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
GValue *return_value);
|
||||
void g_signal_emit_valist (gpointer instance,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
va_list var_args);
|
||||
void g_signal_emit (gpointer instance,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
...);
|
||||
void g_signal_emit_by_name (gpointer instance,
|
||||
const gchar *detailed_signal,
|
||||
...);
|
||||
guint g_signal_lookup (const gchar *name,
|
||||
GType itype);
|
||||
gchar* g_signal_name (guint signal_id);
|
||||
void g_signal_query (guint signal_id,
|
||||
GSignalQuery *query);
|
||||
guint* g_signal_list_ids (GType itype,
|
||||
guint *n_ids);
|
||||
guint g_signal_newv (const gchar *signal_name,
|
||||
GType itype,
|
||||
GSignalFlags signal_flags,
|
||||
GClosure *class_closure,
|
||||
GSignalAccumulator accumulator,
|
||||
GSignalCMarshaller c_marshaller,
|
||||
GType return_type,
|
||||
guint n_params,
|
||||
GType *param_types);
|
||||
guint g_signal_new_valist (const gchar *signal_name,
|
||||
GType itype,
|
||||
GSignalFlags signal_flags,
|
||||
GClosure *class_closure,
|
||||
GSignalAccumulator accumulator,
|
||||
GSignalCMarshaller c_marshaller,
|
||||
GType return_type,
|
||||
guint n_params,
|
||||
va_list args);
|
||||
guint g_signal_newc (const gchar *signal_name,
|
||||
GType itype,
|
||||
GSignalFlags signal_flags,
|
||||
guint class_offset,
|
||||
GSignalAccumulator accumulator,
|
||||
GSignalCMarshaller c_marshaller,
|
||||
GType return_type,
|
||||
guint n_params,
|
||||
...);
|
||||
void g_signal_emitv (const GValue *instance_and_params,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
GValue *return_value);
|
||||
void g_signal_emit_valist (gpointer instance,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
va_list var_args);
|
||||
void g_signal_emit (gpointer instance,
|
||||
guint signal_id,
|
||||
GQuark detail,
|
||||
...);
|
||||
void g_signal_emit_by_name (gpointer instance,
|
||||
const gchar *detailed_signal,
|
||||
...);
|
||||
guint g_signal_lookup (const gchar *name,
|
||||
GType itype);
|
||||
G_CONST_RETURN gchar* g_signal_name (guint signal_id);
|
||||
void g_signal_query (guint signal_id,
|
||||
GSignalQuery *query);
|
||||
guint* g_signal_list_ids (GType itype,
|
||||
guint *n_ids);
|
||||
|
||||
|
||||
/* --- signal emissions --- */
|
||||
void g_signal_stop_emission (gpointer instance,
|
||||
|
@@ -68,7 +68,7 @@ static GStaticRWLock type_rw_lock = G_STATIC_RW_LOCK_INIT;
|
||||
#define G_WRITE_UNLOCK(rw_lock) g_static_rw_lock_writer_unlock (rw_lock)
|
||||
#define INVALID_RECURSION(func, arg, type_name) G_STMT_START{ \
|
||||
static const gchar *_action = " invalidly modified type "; \
|
||||
gpointer _arg = (gpointer) (arg); gchar *_tname = (type_name), *_fname = (func); \
|
||||
gpointer _arg = (gpointer) (arg); const gchar *_tname = (type_name), *_fname = (func); \
|
||||
if (_arg) \
|
||||
g_error ("%s(%p)%s`%s'", _fname, _arg, _action, _tname); \
|
||||
else \
|
||||
@@ -145,7 +145,7 @@ struct _TypeNode
|
||||
#define MAX_N_IFACES (511)
|
||||
#define NODE_TYPE(node) (node->supers[0])
|
||||
#define NODE_PARENT_TYPE(node) (node->supers[1])
|
||||
#define NODE_NAME(node) (g_quark_to_string (node->qname))
|
||||
#define NODE_NAME(node) ((gchar*)g_quark_to_string (node->qname))
|
||||
|
||||
struct _IFaceHolder
|
||||
{
|
||||
@@ -431,13 +431,13 @@ type_descriptive_name_L (GType type)
|
||||
static inline gchar*
|
||||
type_descriptive_name_U (GType type)
|
||||
{
|
||||
gchar *name;
|
||||
const gchar *name;
|
||||
|
||||
G_READ_LOCK (&type_rw_lock);
|
||||
name = type_descriptive_name_L (type);
|
||||
G_READ_UNLOCK (&type_rw_lock);
|
||||
|
||||
return name;
|
||||
return (gchar *)name;
|
||||
}
|
||||
|
||||
|
||||
@@ -1816,7 +1816,7 @@ g_type_value_table_peek (GType type)
|
||||
return vtable;
|
||||
}
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_type_name (GType type)
|
||||
{
|
||||
TypeNode *node;
|
||||
@@ -2409,7 +2409,7 @@ g_type_init (GTypeDebugFlags debug_flags)
|
||||
{
|
||||
G_LOCK_DEFINE_STATIC (type_init_lock);
|
||||
static TypeNode *type0_node = NULL;
|
||||
gchar *env_string;
|
||||
const gchar *env_string;
|
||||
GTypeInfo info;
|
||||
TypeNode *node;
|
||||
GType type;
|
||||
|
@@ -179,34 +179,36 @@ typedef enum /*< skip >*/
|
||||
|
||||
|
||||
/* --- prototypes --- */
|
||||
void g_type_init (GTypeDebugFlags debug_flags);
|
||||
gchar* g_type_name (GType type);
|
||||
GQuark g_type_qname (GType type);
|
||||
GType g_type_from_name (const gchar *name);
|
||||
GType g_type_parent (GType type);
|
||||
GType g_type_next_base (GType type,
|
||||
GType base_type);
|
||||
gboolean g_type_is_a (GType type,
|
||||
GType is_a_type);
|
||||
guint g_type_fundamental_branch_last (GType type);
|
||||
gpointer g_type_class_ref (GType type);
|
||||
gpointer g_type_class_peek (GType type);
|
||||
void g_type_class_unref (gpointer g_class);
|
||||
gpointer g_type_class_peek_parent (gpointer g_class);
|
||||
gpointer g_type_interface_peek (gpointer instance_class,
|
||||
GType iface_type);
|
||||
void g_type_init (GTypeDebugFlags debug_flags);
|
||||
G_CONST_RETURN gchar* g_type_name (GType type);
|
||||
GQuark g_type_qname (GType type);
|
||||
GType g_type_from_name (const gchar *name);
|
||||
GType g_type_parent (GType type);
|
||||
GType g_type_next_base (GType type,
|
||||
GType base_type);
|
||||
gboolean g_type_is_a (GType type,
|
||||
GType is_a_type);
|
||||
guint g_type_fundamental_branch_last (GType type);
|
||||
gpointer g_type_class_ref (GType type);
|
||||
gpointer g_type_class_peek (GType type);
|
||||
void g_type_class_unref (gpointer g_class);
|
||||
gpointer g_type_class_peek_parent (gpointer g_class);
|
||||
gpointer g_type_interface_peek (gpointer instance_class,
|
||||
GType iface_type);
|
||||
|
||||
/* g_free() the returned arrays */
|
||||
GType* g_type_children (GType type,
|
||||
guint *n_children);
|
||||
GType* g_type_interfaces (GType type,
|
||||
guint *n_interfaces);
|
||||
GType* g_type_children (GType type,
|
||||
guint *n_children);
|
||||
GType* g_type_interfaces (GType type,
|
||||
guint *n_interfaces);
|
||||
|
||||
/* per-type _static_ data */
|
||||
void g_type_set_qdata (GType type,
|
||||
GQuark quark,
|
||||
gpointer data);
|
||||
gpointer g_type_get_qdata (GType type,
|
||||
GQuark quark);
|
||||
|
||||
void g_type_set_qdata (GType type,
|
||||
GQuark quark,
|
||||
gpointer data);
|
||||
gpointer g_type_get_qdata (GType type,
|
||||
GQuark quark);
|
||||
|
||||
|
||||
/* --- type registration --- */
|
||||
typedef void (*GBaseInitFunc) (gpointer g_class);
|
||||
|
@@ -735,7 +735,7 @@ g_value_set_static_string (GValue *value,
|
||||
value->data[0].v_pointer = (gchar*) v_string;
|
||||
}
|
||||
|
||||
gchar*
|
||||
G_CONST_RETURN gchar*
|
||||
g_value_get_string (const GValue *value)
|
||||
{
|
||||
g_return_val_if_fail (G_IS_VALUE_STRING (value), NULL);
|
||||
|
@@ -46,51 +46,48 @@ extern "C" {
|
||||
|
||||
|
||||
/* --- prototypes --- */
|
||||
void g_value_set_char (GValue *value,
|
||||
gint8 v_char);
|
||||
gint8 g_value_get_char (const GValue *value);
|
||||
void g_value_set_uchar (GValue *value,
|
||||
guint8 v_uchar);
|
||||
guint8 g_value_get_uchar (const GValue *value);
|
||||
void g_value_set_boolean (GValue *value,
|
||||
gboolean v_boolean);
|
||||
gboolean g_value_get_boolean (const GValue *value);
|
||||
void g_value_set_int (GValue *value,
|
||||
gint v_int);
|
||||
gint g_value_get_int (const GValue *value);
|
||||
void g_value_set_uint (GValue *value,
|
||||
guint v_uint);
|
||||
guint g_value_get_uint (const GValue *value);
|
||||
void g_value_set_long (GValue *value,
|
||||
glong v_long);
|
||||
glong g_value_get_long (const GValue *value);
|
||||
void g_value_set_ulong (GValue *value,
|
||||
gulong v_ulong);
|
||||
gulong g_value_get_ulong (const GValue *value);
|
||||
void g_value_set_float (GValue *value,
|
||||
gfloat v_float);
|
||||
gfloat g_value_get_float (const GValue *value);
|
||||
void g_value_set_double (GValue *value,
|
||||
gdouble v_double);
|
||||
gdouble g_value_get_double (const GValue *value);
|
||||
void g_value_set_string (GValue *value,
|
||||
const gchar *v_string);
|
||||
void g_value_set_static_string (GValue *value,
|
||||
const gchar *v_string);
|
||||
gchar* g_value_get_string (const GValue *value);
|
||||
gchar* g_value_dup_string (const GValue *value);
|
||||
void g_value_set_pointer (GValue *value,
|
||||
gpointer v_pointer);
|
||||
gpointer g_value_get_pointer (const GValue *value);
|
||||
void g_value_set_ccallback (GValue *value,
|
||||
gpointer callback_func,
|
||||
gpointer callback_data);
|
||||
void g_value_get_ccallback (const GValue *value,
|
||||
gpointer *callback_func,
|
||||
gpointer *callback_data);
|
||||
|
||||
|
||||
|
||||
void g_value_set_char (GValue *value,
|
||||
gint8 v_char);
|
||||
gint8 g_value_get_char (const GValue *value);
|
||||
void g_value_set_uchar (GValue *value,
|
||||
guint8 v_uchar);
|
||||
guint8 g_value_get_uchar (const GValue *value);
|
||||
void g_value_set_boolean (GValue *value,
|
||||
gboolean v_boolean);
|
||||
gboolean g_value_get_boolean (const GValue *value);
|
||||
void g_value_set_int (GValue *value,
|
||||
gint v_int);
|
||||
gint g_value_get_int (const GValue *value);
|
||||
void g_value_set_uint (GValue *value,
|
||||
guint v_uint);
|
||||
guint g_value_get_uint (const GValue *value);
|
||||
void g_value_set_long (GValue *value,
|
||||
glong v_long);
|
||||
glong g_value_get_long (const GValue *value);
|
||||
void g_value_set_ulong (GValue *value,
|
||||
gulong v_ulong);
|
||||
gulong g_value_get_ulong (const GValue *value);
|
||||
void g_value_set_float (GValue *value,
|
||||
gfloat v_float);
|
||||
gfloat g_value_get_float (const GValue *value);
|
||||
void g_value_set_double (GValue *value,
|
||||
gdouble v_double);
|
||||
gdouble g_value_get_double (const GValue *value);
|
||||
void g_value_set_string (GValue *value,
|
||||
const gchar *v_string);
|
||||
void g_value_set_static_string (GValue *value,
|
||||
const gchar *v_string);
|
||||
G_CONST_RETURN gchar* g_value_get_string (const GValue *value);
|
||||
gchar* g_value_dup_string (const GValue *value);
|
||||
void g_value_set_pointer (GValue *value,
|
||||
gpointer v_pointer);
|
||||
gpointer g_value_get_pointer (const GValue *value);
|
||||
void g_value_set_ccallback (GValue *value,
|
||||
gpointer callback_func,
|
||||
gpointer callback_data);
|
||||
void g_value_get_ccallback (const GValue *value,
|
||||
gpointer *callback_func,
|
||||
gpointer *callback_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user