Added strict warning flags to CFLAGS.
We miss the strict warning flags for a long time, now add it back. This commit also fixed most of the warnings after enable the strict flags. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
parent
6839996b0b
commit
c5b3c2cedc
|
@ -15,7 +15,7 @@ instdir = $(moduledir)
|
|||
INCLUDES = \
|
||||
$(XORG_INCS)
|
||||
|
||||
AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
|
||||
AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
|
||||
|
||||
libglamor_la_LDFLAGS = -avoid-version
|
||||
|
||||
|
|
|
@ -465,12 +465,11 @@ glamor_close_screen(int idx, ScreenPtr screen)
|
|||
glamor_screen_private *glamor_priv;
|
||||
PixmapPtr screen_pixmap;
|
||||
int flags;
|
||||
|
||||
glamor_priv = glamor_get_screen_private(screen);
|
||||
flags = glamor_priv->flags;
|
||||
#ifdef RENDER
|
||||
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
|
||||
#endif
|
||||
glamor_priv = glamor_get_screen_private(screen);
|
||||
flags = glamor_priv->flags;
|
||||
glamor_glyphs_fini(screen);
|
||||
screen->CloseScreen = glamor_priv->saved_procs.close_screen;
|
||||
if (flags & GLAMOR_USE_SCREEN) {
|
||||
|
|
|
@ -157,6 +157,9 @@ extern _X_EXPORT void glamor_egl_restore_context(ScreenPtr screen);
|
|||
* */
|
||||
extern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back);
|
||||
|
||||
extern _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back);
|
||||
|
||||
|
||||
#ifdef GLAMOR_FOR_XORG
|
||||
|
||||
#define GLAMOR_EGL_MODULE_NAME "glamoregl"
|
||||
|
|
|
@ -91,7 +91,8 @@ struct glamor_egl_screen_private {
|
|||
struct gbm_device *gbm;
|
||||
#endif
|
||||
int has_gem;
|
||||
void *gl_context, *old_context;
|
||||
void *glamor_context;
|
||||
void *current_context;
|
||||
int gl_context_depth;
|
||||
|
||||
PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr;
|
||||
|
@ -121,10 +122,9 @@ glamor_egl_make_current(ScreenPtr screen)
|
|||
if (glamor_egl->gl_context_depth++)
|
||||
return;
|
||||
|
||||
GET_CURRENT_CONTEXT(current);
|
||||
glamor_egl->old_context = current;
|
||||
GET_CURRENT_CONTEXT(glamor_egl->current_context);
|
||||
|
||||
if (glamor_egl->gl_context != current) {
|
||||
if (glamor_egl->glamor_context != glamor_egl->current_context) {
|
||||
eglMakeCurrent(glamor_egl->display, EGL_NO_SURFACE,
|
||||
EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
if (!eglMakeCurrent(glamor_egl->display,
|
||||
|
@ -145,9 +145,9 @@ glamor_egl_restore_context(ScreenPtr screen)
|
|||
if (--glamor_egl->gl_context_depth)
|
||||
return;
|
||||
|
||||
if (glamor_egl->old_context &&
|
||||
glamor_egl->gl_context != glamor_egl->old_context)
|
||||
SET_CURRENT_CONTEXT(glamor_egl->old_context);
|
||||
if (glamor_egl->current_context &&
|
||||
glamor_egl->glamor_context != glamor_egl->current_context)
|
||||
SET_CURRENT_CONTEXT(glamor_egl->current_context);
|
||||
}
|
||||
#else
|
||||
#define glamor_egl_make_current(x)
|
||||
|
@ -255,7 +255,7 @@ glamor_egl_create_textured_screen_ext(ScreenPtr screen,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
glamor_egl_check_has_gem(int fd)
|
||||
{
|
||||
struct drm_gem_flink flink;
|
||||
|
@ -548,8 +548,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
|
|||
return FALSE;
|
||||
}
|
||||
#ifdef GLX_USE_SHARED_DISPATCH
|
||||
GET_CURRENT_CONTEXT(current);
|
||||
glamor_egl->gl_context = current;
|
||||
GET_CURRENT_CONTEXT(glamor_egl->glamor_context);
|
||||
#endif
|
||||
glamor_egl->saved_free_screen = scrn->FreeScreen;
|
||||
scrn->FreeScreen = glamor_egl_free_screen;
|
||||
|
|
|
@ -92,7 +92,7 @@ inline static int cache_hbucket(int size)
|
|||
return order;
|
||||
}
|
||||
|
||||
glamor_pixmap_fbo *
|
||||
static glamor_pixmap_fbo *
|
||||
glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
|
||||
int w, int h, GLenum format, int flag)
|
||||
{
|
||||
|
@ -380,7 +380,7 @@ glamor_destroy_fbo(glamor_pixmap_fbo *fbo)
|
|||
|
||||
}
|
||||
|
||||
glamor_pixmap_fbo *
|
||||
static glamor_pixmap_fbo *
|
||||
glamor_create_tex_obj(glamor_screen_private *glamor_priv,
|
||||
int w, int h, GLenum format, int flag)
|
||||
{
|
||||
|
@ -422,7 +422,7 @@ glamor_create_tex_obj(glamor_screen_private *glamor_priv,
|
|||
return fbo;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
glamor_destroy_tex_obj(glamor_pixmap_fbo * tex_obj)
|
||||
{
|
||||
assert(tex_obj->fb == 0);
|
||||
|
@ -430,7 +430,7 @@ glamor_destroy_tex_obj(glamor_pixmap_fbo * tex_obj)
|
|||
glamor_pixmap_fbo_cache_put(tex_obj);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
_glamor_create_tex(glamor_screen_private *glamor_priv,
|
||||
int w, int h, GLenum format)
|
||||
{
|
||||
|
|
|
@ -185,7 +185,7 @@ glamor_set_alu(struct glamor_gl_dispatch *dispatch, unsigned char alu)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void *
|
||||
static void *
|
||||
_glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, int stride, int revert)
|
||||
{
|
||||
PictFormatShort dst_format, src_format;
|
||||
|
@ -269,7 +269,7 @@ _glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, int st
|
|||
(*dst) = ((a) << (a_shift)) | ((r) << (b_shift)) | ((g) << (g_shift)) | ((b) << (r_shift)); \
|
||||
}
|
||||
|
||||
void *
|
||||
static void *
|
||||
_glamor_color_revert_x2b10g10r10(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb)
|
||||
{
|
||||
int x,y;
|
||||
|
@ -306,7 +306,7 @@ _glamor_color_revert_x2b10g10r10(void *src_bits, void *dst_bits, int w, int h, i
|
|||
|
||||
}
|
||||
|
||||
void *
|
||||
static void *
|
||||
_glamor_color_revert_x1b5g5r5(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb)
|
||||
{
|
||||
int x,y;
|
||||
|
@ -360,7 +360,7 @@ _glamor_color_revert_x1b5g5r5(void *src_bits, void *dst_bits, int w, int h, int
|
|||
*
|
||||
*/
|
||||
|
||||
void *
|
||||
static void *
|
||||
glamor_color_convert_to_bits(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb)
|
||||
{
|
||||
if (revert == REVERT_DOWNLOADING_A1 || revert == REVERT_UPLOADING_A1) {
|
||||
|
@ -917,8 +917,8 @@ glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, int x, int y, int w, int h,
|
|||
read = dispatch->glMapBuffer(GL_PIXEL_PACK_BUFFER,
|
||||
GL_READ_ONLY);
|
||||
for (yy = 0; yy < pixmap->drawable.height; yy++)
|
||||
memcpy(data + yy * stride,
|
||||
read + (h - yy - 1) * stride, stride);
|
||||
memcpy((char*)data + yy * stride,
|
||||
(char*)read + (h - yy - 1) * stride, stride);
|
||||
dispatch->glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
|
||||
dispatch->glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
||||
dispatch->glDeleteBuffers(1, &temp_pbo);
|
||||
|
|
|
@ -961,11 +961,11 @@ glamor_composite_with_shader(CARD8 op,
|
|||
PictFormatShort saved_source_format = 0;
|
||||
float src_matrix[9], mask_matrix[9];
|
||||
GLfloat source_solid_color[4], mask_solid_color[4];
|
||||
dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
|
||||
int vert_stride = 4;
|
||||
int nrect_max;
|
||||
Bool ret = FALSE;
|
||||
|
||||
dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
|
||||
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) {
|
||||
glamor_fallback("dest has no fbo.\n");
|
||||
goto fail;
|
||||
|
|
|
@ -886,9 +886,9 @@ static inline void _glamor_compare_pixmaps(PixmapPtr pixmap1, PixmapPtr pixmap2,
|
|||
int little_endian = 0;
|
||||
unsigned char *p_test;
|
||||
int bpp = pixmap1->drawable.depth == 8 ? 1 : 4;
|
||||
int stride = pixmap1->devKind;
|
||||
|
||||
assert(pixmap1->devKind == pixmap2->devKind);
|
||||
int stride = pixmap1->devKind;
|
||||
|
||||
ErrorF("stride:%d, width:%d, height:%d\n", stride, w, h);
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ extern const struct _glapi_table *_glapi_Dispatch;
|
|||
extern const void *_glapi_Context;
|
||||
|
||||
# define GET_DISPATCH() _glapi_tls_Dispatch
|
||||
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_tls_Context
|
||||
# define GET_CURRENT_CONTEXT(C) C = (typeof(C)) _glapi_tls_Context
|
||||
# define SET_CURRENT_CONTEXT(C) _glapi_tls_Context = (void*)C
|
||||
|
||||
#else
|
||||
|
@ -92,7 +92,7 @@ extern void *_glapi_Context;
|
|||
# define GET_DISPATCH() \
|
||||
(likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch())
|
||||
|
||||
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \
|
||||
# define GET_CURRENT_CONTEXT(C) C = (typeof(C)) \
|
||||
(likely(_glapi_Context) ? _glapi_Context : _glapi_get_context())
|
||||
|
||||
|
||||
|
@ -104,7 +104,7 @@ extern void *_glapi_Context;
|
|||
# else
|
||||
|
||||
# define GET_DISPATCH() _glapi_Dispatch
|
||||
# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_Context
|
||||
# define GET_CURRENT_CONTEXT(C) C = (typeof(C)) _glapi_Context
|
||||
# define SET_CURRENT_CONTEXT(C) _glapi_Context = (void*)C
|
||||
|
||||
# endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user