Fix const qualifier usage
As with the commits earlier, this also adds const qualifiers where expected. However, the const variables are casted to non-const variants so they can be passed to glib functions that take non-const variants but expect const-like input.
This commit is contained in:
parent
f615eea7ee
commit
01cea0d9ef
@ -161,13 +161,13 @@ set_egl_error (GError **error)
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_extensions_string_has_extensions_valist (const char *extensions_str,
|
||||
char ***missing_extensions,
|
||||
char *first_extension,
|
||||
va_list var_args)
|
||||
meta_extensions_string_has_extensions_valist (const char *extensions_str,
|
||||
const char ***missing_extensions,
|
||||
const char *first_extension,
|
||||
va_list var_args)
|
||||
{
|
||||
char **extensions;
|
||||
char *extension;
|
||||
const char *extension;
|
||||
size_t num_missing_extensions = 0;
|
||||
|
||||
if (missing_extensions)
|
||||
@ -203,10 +203,10 @@ meta_extensions_string_has_extensions_valist (const char *extensions_str,
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_egl_has_extensions (MetaEgl *egl,
|
||||
EGLDisplay display,
|
||||
char ***missing_extensions,
|
||||
char *first_extension,
|
||||
meta_egl_has_extensions (MetaEgl *egl,
|
||||
EGLDisplay display,
|
||||
const char ***missing_extensions,
|
||||
const char *first_extension,
|
||||
...)
|
||||
{
|
||||
va_list var_args;
|
||||
@ -669,10 +669,10 @@ meta_egl_query_device_string (MetaEgl *egl,
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_egl_egl_device_has_extensions (MetaEgl *egl,
|
||||
EGLDeviceEXT device,
|
||||
char ***missing_extensions,
|
||||
char *first_extension,
|
||||
meta_egl_egl_device_has_extensions (MetaEgl *egl,
|
||||
EGLDeviceEXT device,
|
||||
const char ***missing_extensions,
|
||||
const char *first_extension,
|
||||
...)
|
||||
{
|
||||
va_list var_args;
|
||||
|
@ -37,15 +37,15 @@ G_DECLARE_FINAL_TYPE (MetaEgl, meta_egl, META, EGL, GObject)
|
||||
GQuark meta_egl_error_quark (void);
|
||||
|
||||
gboolean
|
||||
meta_extensions_string_has_extensions_valist (const char *extensions_str,
|
||||
char ***missing_extensions,
|
||||
char *first_extension,
|
||||
va_list var_args);
|
||||
meta_extensions_string_has_extensions_valist (const char *extensions_str,
|
||||
const char ***missing_extensions,
|
||||
const char *first_extension,
|
||||
va_list var_args);
|
||||
|
||||
gboolean meta_egl_has_extensions (MetaEgl *egl,
|
||||
EGLDisplay display,
|
||||
char ***missing_extensions,
|
||||
char *first_extension,
|
||||
gboolean meta_egl_has_extensions (MetaEgl *egl,
|
||||
EGLDisplay display,
|
||||
const char ***missing_extensions,
|
||||
const char *first_extension,
|
||||
...);
|
||||
|
||||
gboolean meta_egl_initialize (MetaEgl *egl,
|
||||
@ -158,10 +158,10 @@ const char * meta_egl_query_device_string (MetaEgl *egl,
|
||||
EGLint name,
|
||||
GError **error);
|
||||
|
||||
gboolean meta_egl_egl_device_has_extensions (MetaEgl *egl,
|
||||
EGLDeviceEXT device,
|
||||
char ***missing_extensions,
|
||||
char *first_extension,
|
||||
gboolean meta_egl_egl_device_has_extensions (MetaEgl *egl,
|
||||
EGLDeviceEXT device,
|
||||
const char ***missing_extensions,
|
||||
const char *first_extension,
|
||||
...);
|
||||
|
||||
gboolean meta_egl_get_output_layers (MetaEgl *egl,
|
||||
|
@ -114,9 +114,9 @@ meta_gles3_validate (MetaGles3 *gles3,
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_gles3_has_extensions (MetaGles3 *gles3,
|
||||
char ***missing_extensions,
|
||||
char *first_extension,
|
||||
meta_gles3_has_extensions (MetaGles3 *gles3,
|
||||
const char ***missing_extensions,
|
||||
const char *first_extension,
|
||||
...)
|
||||
{
|
||||
va_list var_args;
|
||||
|
@ -43,9 +43,9 @@ void meta_gles3_ensure_loaded (MetaGles3 *gles,
|
||||
gpointer *func,
|
||||
const char *name);
|
||||
|
||||
gboolean meta_gles3_has_extensions (MetaGles3 *gles3,
|
||||
char ***missing_extensions,
|
||||
char *first_extension,
|
||||
gboolean meta_gles3_has_extensions (MetaGles3 *gles3,
|
||||
const char ***missing_extensions,
|
||||
const char *first_extension,
|
||||
...);
|
||||
|
||||
MetaGles3 * meta_gles3_new (MetaEgl *egl);
|
||||
|
@ -3207,7 +3207,7 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
|
||||
EGLDisplay egl_display = renderer_gpu_data->egl_display;
|
||||
EGLConfig egl_config;
|
||||
EGLContext egl_context;
|
||||
char **missing_gl_extensions;
|
||||
const char **missing_gl_extensions;
|
||||
const char *renderer_str;
|
||||
gboolean is_hardware;
|
||||
|
||||
@ -3247,7 +3247,8 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
|
||||
{
|
||||
char *missing_gl_extensions_str;
|
||||
|
||||
missing_gl_extensions_str = g_strjoinv (", ", missing_gl_extensions);
|
||||
missing_gl_extensions_str = g_strjoinv (", ",
|
||||
(char **) missing_gl_extensions);
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Missing OpenGL ES extensions: %s",
|
||||
missing_gl_extensions_str);
|
||||
@ -3381,7 +3382,7 @@ find_egl_device (MetaRendererNative *renderer_native,
|
||||
GError **error)
|
||||
{
|
||||
MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
|
||||
char **missing_extensions;
|
||||
const char **missing_extensions;
|
||||
EGLint num_devices;
|
||||
EGLDeviceEXT *devices;
|
||||
const char *kms_file_path;
|
||||
@ -3396,7 +3397,7 @@ find_egl_device (MetaRendererNative *renderer_native,
|
||||
{
|
||||
char *missing_extensions_str;
|
||||
|
||||
missing_extensions_str = g_strjoinv (", ", missing_extensions);
|
||||
missing_extensions_str = g_strjoinv (", ", (char **) missing_extensions);
|
||||
g_set_error (error, G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"Missing EGL extensions required for EGLDevice renderer: %s",
|
||||
@ -3484,7 +3485,7 @@ create_renderer_gpu_data_egl_device (MetaRendererNative *renderer_native,
|
||||
GError **error)
|
||||
{
|
||||
MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
|
||||
char **missing_extensions;
|
||||
const char **missing_extensions;
|
||||
EGLDeviceEXT egl_device;
|
||||
EGLDisplay egl_display;
|
||||
MetaRendererNativeGpuData *renderer_gpu_data;
|
||||
@ -3523,7 +3524,7 @@ create_renderer_gpu_data_egl_device (MetaRendererNative *renderer_native,
|
||||
{
|
||||
char *missing_extensions_str;
|
||||
|
||||
missing_extensions_str = g_strjoinv (", ", missing_extensions);
|
||||
missing_extensions_str = g_strjoinv (", ", (char **) missing_extensions);
|
||||
g_set_error (error, G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"Missing EGL extensions required for EGLDevice renderer: %s",
|
||||
|
@ -356,7 +356,7 @@ meta_xwayland_global_filter (const struct wl_client *client,
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_override_display_name (char *display_name)
|
||||
meta_wayland_override_display_name (const char *display_name)
|
||||
{
|
||||
g_clear_pointer (&_display_name_override, g_free);
|
||||
_display_name_override = g_strdup (display_name);
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "meta/types.h"
|
||||
#include "wayland/meta-wayland-types.h"
|
||||
|
||||
void meta_wayland_override_display_name (char *display_name);
|
||||
void meta_wayland_override_display_name (const char *display_name);
|
||||
|
||||
void meta_wayland_pre_clutter_init (void);
|
||||
void meta_wayland_init (void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user