diff options
author | Dennis Kasprzyk <onestone@opencompositing.org> | 2008-07-25 23:54:30 +0200 |
---|---|---|
committer | Dennis kasprzyk <onestone@opencompositing.org> | 2008-07-25 23:54:30 +0200 |
commit | 0e942665257980878d6271cbcad4647d04204093 (patch) | |
tree | 83ca2da9686e90a5f257a360e5a15e4158165907 | |
parent | 83e50fca60fb85aff79e4b6118ad57361caa6a8a (diff) | |
download | compiz-with-glib-mainloop-0e942665257980878d6271cbcad4647d04204093.tar.gz compiz-with-glib-mainloop-0e942665257980878d6271cbcad4647d04204093.tar.bz2 |
Switch to c++ and compile with a basic set of plugins.
-rw-r--r-- | include/compiz-core.h | 12 | ||||
-rw-r--r-- | plugins/Makefile.am | 243 | ||||
-rw-r--r-- | plugins/annotate.cpp (renamed from plugins/annotate.c) | 0 | ||||
-rw-r--r-- | plugins/blur.cpp (renamed from plugins/blur.c) | 0 | ||||
-rw-r--r-- | plugins/clone.cpp (renamed from plugins/clone.c) | 0 | ||||
-rw-r--r-- | plugins/cube.cpp (renamed from plugins/cube.c) | 0 | ||||
-rw-r--r-- | plugins/dbus.cpp (renamed from plugins/dbus.c) | 0 | ||||
-rw-r--r-- | plugins/decoration.cpp (renamed from plugins/decoration.c) | 18 | ||||
-rw-r--r-- | plugins/fade.cpp (renamed from plugins/fade.c) | 0 | ||||
-rw-r--r-- | plugins/fuse.cpp (renamed from plugins/fuse.c) | 0 | ||||
-rw-r--r-- | plugins/gconf.cpp (renamed from plugins/gconf.c) | 4 | ||||
-rw-r--r-- | plugins/glib.cpp (renamed from plugins/glib.c) | 4 | ||||
-rw-r--r-- | plugins/ini.cpp (renamed from plugins/ini.c) | 0 | ||||
-rw-r--r-- | plugins/inotify.cpp (renamed from plugins/inotify.c) | 0 | ||||
-rw-r--r-- | plugins/minimize.cpp (renamed from plugins/minimize.c) | 0 | ||||
-rw-r--r-- | plugins/move.cpp (renamed from plugins/move.c) | 6 | ||||
-rw-r--r-- | plugins/place.cpp (renamed from plugins/place.c) | 0 | ||||
-rw-r--r-- | plugins/png.cpp (renamed from plugins/png.c) | 0 | ||||
-rw-r--r-- | plugins/regex.cpp (renamed from plugins/regex.c) | 0 | ||||
-rw-r--r-- | plugins/resize.cpp (renamed from plugins/resize.c) | 6 | ||||
-rw-r--r-- | plugins/rotate.cpp (renamed from plugins/rotate.c) | 0 | ||||
-rw-r--r-- | plugins/scale.cpp (renamed from plugins/scale.c) | 0 | ||||
-rw-r--r-- | plugins/screenshot.cpp (renamed from plugins/screenshot.c) | 0 | ||||
-rw-r--r-- | plugins/svg.cpp (renamed from plugins/svg.c) | 0 | ||||
-rw-r--r-- | plugins/switcher.cpp (renamed from plugins/switcher.c) | 0 | ||||
-rw-r--r-- | plugins/video.cpp (renamed from plugins/video.c) | 0 | ||||
-rw-r--r-- | plugins/water.cpp (renamed from plugins/water.c) | 0 | ||||
-rw-r--r-- | plugins/wobbly.cpp (renamed from plugins/wobbly.c) | 0 | ||||
-rw-r--r-- | plugins/zoom.cpp (renamed from plugins/zoom.c) | 6 | ||||
-rw-r--r-- | src/Makefile.am | 36 | ||||
-rw-r--r-- | src/action.cpp (renamed from src/action.c) | 0 | ||||
-rw-r--r-- | src/core.cpp (renamed from src/core.c) | 2 | ||||
-rw-r--r-- | src/cursor.cpp (renamed from src/cursor.c) | 4 | ||||
-rw-r--r-- | src/display.cpp (renamed from src/display.c) | 22 | ||||
-rw-r--r-- | src/event.cpp (renamed from src/event.c) | 8 | ||||
-rw-r--r-- | src/fragment.cpp (renamed from src/fragment.c) | 34 | ||||
-rw-r--r-- | src/main.cpp (renamed from src/main.c) | 4 | ||||
-rw-r--r-- | src/match.cpp (renamed from src/match.c) | 36 | ||||
-rw-r--r-- | src/matrix.cpp (renamed from src/matrix.c) | 0 | ||||
-rw-r--r-- | src/metadata.cpp (renamed from src/metadata.c) | 12 | ||||
-rw-r--r-- | src/object.cpp (renamed from src/object.c) | 0 | ||||
-rw-r--r-- | src/option.cpp (renamed from src/option.c) | 4 | ||||
-rw-r--r-- | src/paint.cpp (renamed from src/paint.c) | 6 | ||||
-rw-r--r-- | src/plugin.cpp (renamed from src/plugin.c) | 18 | ||||
-rw-r--r-- | src/privates.cpp (renamed from src/privates.c) | 0 | ||||
-rw-r--r-- | src/screen.cpp (renamed from src/screen.c) | 40 | ||||
-rw-r--r-- | src/session.cpp (renamed from src/session.c) | 4 | ||||
-rw-r--r-- | src/texture.cpp (renamed from src/texture.c) | 10 | ||||
-rw-r--r-- | src/window.cpp (renamed from src/window.c) | 136 |
49 files changed, 341 insertions, 334 deletions
diff --git a/include/compiz-core.h b/include/compiz-core.h index bbfcb5d..5d67aae 100644 --- a/include/compiz-core.h +++ b/include/compiz-core.h @@ -385,7 +385,9 @@ typedef enum { CompBindingTypeKey = 1 << 0, CompBindingTypeButton = 1 << 1, CompBindingTypeEdgeButton = 1 << 2 -} CompBindingType; +} CompBindingTypeEnum; + +typedef unsigned int CompBindingType; typedef enum { CompActionStateInitKey = 1 << 0, @@ -401,7 +403,9 @@ typedef enum { CompActionStateCancel = 1 << 10, CompActionStateAutoGrab = 1 << 11, CompActionStateNoEdgeDelay = 1 << 12 -} CompActionState; +} CompActionStateEnum; + +typedef unsigned int CompActionState; typedef enum { CompLogLevelFatal = 0, @@ -1610,7 +1614,9 @@ paintCursor (CompCursor *cursor, typedef enum { COMP_TEXTURE_FILTER_FAST, COMP_TEXTURE_FILTER_GOOD -} CompTextureFilter; +} CompTextureFilterEnum; + +typedef int CompTextureFilter; struct _CompTexture { GLuint name; diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 4840189..ce90a87 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -1,127 +1,127 @@ -libfade_la_LDFLAGS = -module -avoid-version -no-undefined -libfade_la_SOURCES = fade.c - -libcube_la_LDFLAGS = -module -avoid-version -no-undefined -libcube_la_SOURCES = cube.c - -librotate_la_LDFLAGS = -module -avoid-version -no-undefined -librotate_la_SOURCES = rotate.c +# libfade_la_LDFLAGS = -module -avoid-version -no-undefined +# libfade_la_SOURCES = fade.cpp +# +# libcube_la_LDFLAGS = -module -avoid-version -no-undefined +# libcube_la_SOURCES = cube.cpp +# +# librotate_la_LDFLAGS = -module -avoid-version -no-undefined +# librotate_la_SOURCES = rotate.cpp libzoom_la_LDFLAGS = -module -avoid-version -no-undefined -libzoom_la_SOURCES = zoom.c - -libscale_la_LDFLAGS = -module -avoid-version -no-undefined -libscale_la_SOURCES = scale.c +libzoom_la_SOURCES = zoom.cpp -libwobbly_la_LDFLAGS = -module -avoid-version -no-undefined -libwobbly_la_SOURCES = wobbly.c - -libminimize_la_LDFLAGS = -module -avoid-version -no-undefined -libminimize_la_SOURCES = minimize.c +# libscale_la_LDFLAGS = -module -avoid-version -no-undefined +# libscale_la_SOURCES = scale.cpp +# +# libwobbly_la_LDFLAGS = -module -avoid-version -no-undefined +# libwobbly_la_SOURCES = wobbly.cpp +# +# libminimize_la_LDFLAGS = -module -avoid-version -no-undefined +# libminimize_la_SOURCES = minimize.cpp libmove_la_LDFLAGS = -module -avoid-version -no-undefined -libmove_la_SOURCES = move.c +libmove_la_SOURCES = move.cpp libresize_la_LDFLAGS = -module -avoid-version -no-undefined -libresize_la_SOURCES = resize.c +libresize_la_SOURCES = resize.cpp -libplace_la_LDFLAGS = -module -avoid-version -no-undefined -libplace_la_SOURCES = place.c +# libplace_la_LDFLAGS = -module -avoid-version -no-undefined +# libplace_la_SOURCES = place.cpp libdecoration_la_DEPENDENCIES = $(top_builddir)/libdecoration/libdecoration.la libdecoration_la_LDFLAGS = -module -avoid-version -no-undefined libdecoration_la_LIBADD = $(top_builddir)/libdecoration/libdecoration.la -libdecoration_la_SOURCES = decoration.c - -libswitcher_la_LDFLAGS = -module -avoid-version -no-undefined -libswitcher_la_SOURCES = switcher.c - -libwater_la_LDFLAGS = -module -avoid-version -no-undefined -libwater_la_SOURCES = water.c - -libscreenshot_la_LDFLAGS = -module -avoid-version -no-undefined -libscreenshot_la_SOURCES = screenshot.c - -libclone_la_LDFLAGS = -module -avoid-version -no-undefined -libclone_la_SOURCES = clone.c - -libpng_la_LDFLAGS = -module -avoid-version -no-undefined -libpng_la_LIBADD = @LIBPNG_LIBS@ -libpng_la_SOURCES = png.c - -libblur_la_DEPENDENCIES = $(top_builddir)/libdecoration/libdecoration.la -libblur_la_LDFLAGS = -module -avoid-version -no-undefined -libblur_la_LIBADD = $(top_builddir)/libdecoration/libdecoration.la -lGLU -libblur_la_SOURCES = blur.c - -libregex_la_LDFLAGS = -module -avoid-version -no-undefined -libregex_la_SOURCES = regex.c - -libvideo_la_DEPENDENCIES = $(top_builddir)/libdecoration/libdecoration.la -libvideo_la_LDFLAGS = -module -avoid-version -no-undefined -libvideo_la_LIBADD = $(top_builddir)/libdecoration/libdecoration.la -libvideo_la_SOURCES = video.c - -libini_la_LDFLAGS = -module -avoid-version -no-undefined -libini_la_SOURCES = ini.c - -if USE_LIBRSVG -libsvg_la_DEPENDENCIES = $(top_builddir)/libdecoration/libdecoration.la -libsvg_la_LDFLAGS = -module -avoid-version -no-undefined -libsvg_la_LIBADD = \ - $(top_builddir)/libdecoration/libdecoration.la \ - @LIBRSVG_LIBS@ -libsvg_la_SOURCES = svg.c -libsvg_module = libsvg.la -endif - -if ANNOTATE_PLUGIN -libannotate_la_LDFLAGS = -module -avoid-version -no-undefined -libannotate_la_LIBADD = @ANNOTATE_LIBS@ -libannotate_la_SOURCES = annotate.c -libannotate_module = libannotate.la -endif +libdecoration_la_SOURCES = decoration.cpp + +# libswitcher_la_LDFLAGS = -module -avoid-version -no-undefined +# libswitcher_la_SOURCES = switcher.cpp +# +# libwater_la_LDFLAGS = -module -avoid-version -no-undefined +# libwater_la_SOURCES = water.cpp +# +# libscreenshot_la_LDFLAGS = -module -avoid-version -no-undefined +# libscreenshot_la_SOURCES = screenshot.cpp +# +# libclone_la_LDFLAGS = -module -avoid-version -no-undefined +# libclone_la_SOURCES = clone.cpp +# +# libpng_la_LDFLAGS = -module -avoid-version -no-undefined +# libpng_la_LIBADD = @LIBPNG_LIBS@ +# libpng_la_SOURCES = png.cpp +# +# libblur_la_DEPENDENCIES = $(top_builddir)/libdecoration/libdecoration.la +# libblur_la_LDFLAGS = -module -avoid-version -no-undefined +# libblur_la_LIBADD = $(top_builddir)/libdecoration/libdecoration.la -lGLU +# libblur_la_SOURCES = blur.cpp +# +# libregex_la_LDFLAGS = -module -avoid-version -no-undefined +# libregex_la_SOURCES = regex.cpp +# +# libvideo_la_DEPENDENCIES = $(top_builddir)/libdecoration/libdecoration.la +# libvideo_la_LDFLAGS = -module -avoid-version -no-undefined +# libvideo_la_LIBADD = $(top_builddir)/libdecoration/libdecoration.la +# libvideo_la_SOURCES = video.cpp +# +# libini_la_LDFLAGS = -module -avoid-version -no-undefined +# libini_la_SOURCES = ini.cpp +# +# if USE_LIBRSVG +# libsvg_la_DEPENDENCIES = $(top_builddir)/libdecoration/libdecoration.la +# libsvg_la_LDFLAGS = -module -avoid-version -no-undefined +# libsvg_la_LIBADD = \ +# $(top_builddir)/libdecoration/libdecoration.la \ +# @LIBRSVG_LIBS@ +# libsvg_la_SOURCES = svg.cpp +# libsvg_module = libsvg.la +# endif +# +# if ANNOTATE_PLUGIN +# libannotate_la_LDFLAGS = -module -avoid-version -no-undefined +# libannotate_la_LIBADD = @ANNOTATE_LIBS@ +# libannotate_la_SOURCES = annotate.cpp +# libannotate_module = libannotate.la +# endif if USE_GLIB libglib_la_LDFLAGS = -module -avoid-version -no-undefined libglib_la_LIBADD = @GLIB_LIBS@ -libglib_la_SOURCES = glib.c +libglib_la_SOURCES = glib.cpp libglib_module = libglib.la endif if USE_GCONF libgconf_la_LDFLAGS = -module -avoid-version -no-undefined libgconf_la_LIBADD = @GCONF_LIBS@ -libgconf_la_SOURCES = gconf.c +libgconf_la_SOURCES = gconf.cpp libgconf_module = libgconf.la endif -if USE_KCONFIG -libkconfig_la_LDFLAGS = -module -avoid-version -no-undefined -libkconfig_la_LIBADD = @KCONFIG_LIBS@ -libkconfig_la_SOURCES = kconfig.cpp -libkconfig_module = libkconfig.la -endif - -if DBUS_PLUGIN -libdbus_la_LDFLAGS = -module -avoid-version -no-undefined -libdbus_la_LIBADD = @DBUS_LIBS@ -libdbus_la_SOURCES = dbus.c -libdbus_module = libdbus.la -endif - -if INOTIFY_PLUGIN -libinotify_la_LDFLAGS = -module -avoid-version -no-undefined -libinotify_la_SOURCES = inotify.c -libinotify_module = libinotify.la -endif - -if FUSE_PLUGIN -libfs_la_LDFLAGS = -module -avoid-version -no-undefined -libfs_la_LIBADD = @FUSE_LIBS@ -libfs_la_SOURCES = fuse.c -libfs_module = libfs.la -endif +# if USE_KCONFIG +# libkconfig_la_LDFLAGS = -module -avoid-version -no-undefined +# libkconfig_la_LIBADD = @KCONFIG_LIBS@ +# libkconfig_la_SOURCES = kconfig.cpp +# libkconfig_module = libkconfig.la +# endif +# +# if DBUS_PLUGIN +# libdbus_la_LDFLAGS = -module -avoid-version -no-undefined +# libdbus_la_LIBADD = @DBUS_LIBS@ +# libdbus_la_SOURCES = dbus.cpp +# libdbus_module = libdbus.la +# endif +# +# if INOTIFY_PLUGIN +# libinotify_la_LDFLAGS = -module -avoid-version -no-undefined +# libinotify_la_SOURCES = inotify.cpp +# libinotify_module = libinotify.la +# endif +# +# if FUSE_PLUGIN +# libfs_la_LDFLAGS = -module -avoid-version -no-undefined +# libfs_la_LIBADD = @FUSE_LIBS@ +# libfs_la_SOURCES = fuse.cpp +# libfs_module = libfs.la +# endif INCLUDES = \ @COMPIZ_CFLAGS@ \ @@ -149,28 +149,29 @@ module_LTLIBRARIES = \ $(libgconf_module) \ $(libkconfig_module) \ libdecoration.la \ - libwobbly.la \ - libfade.la \ - libminimize.la \ - libcube.la \ - librotate.la \ libzoom.la \ - libscale.la \ libmove.la \ - libresize.la \ - libplace.la \ - $(libdbus_module) \ - libswitcher.la \ - libwater.la \ - libscreenshot.la \ - libclone.la \ - libpng.la \ - libblur.la \ - libregex.la \ - libvideo.la \ - libini.la \ - $(libsvg_module) \ - $(libannotate_module) \ - $(libinotify_module) \ - $(libfs_module) + libresize.la +# +# libwobbly.la \ +# libfade.la \ +# libminimize.la \ +# libcube.la \ +# librotate.la \ +# libscale.la \ +# libplace.la \ +# $(libdbus_module) \ +# libswitcher.la \ +# libwater.la \ +# libscreenshot.la \ +# libclone.la \ +# libpng.la \ +# libblur.la \ +# libregex.la \ +# libvideo.la \ +# libini.la \ +# $(libsvg_module) \ +# $(libannotate_module) \ +# $(libinotify_module) \ +# $(libfs_module) diff --git a/plugins/annotate.c b/plugins/annotate.cpp index c377dee..c377dee 100644 --- a/plugins/annotate.c +++ b/plugins/annotate.cpp diff --git a/plugins/blur.c b/plugins/blur.cpp index 093b1b8..093b1b8 100644 --- a/plugins/blur.c +++ b/plugins/blur.cpp diff --git a/plugins/clone.c b/plugins/clone.cpp index 31b78a6..31b78a6 100644 --- a/plugins/clone.c +++ b/plugins/clone.cpp diff --git a/plugins/cube.c b/plugins/cube.cpp index fffa851..fffa851 100644 --- a/plugins/cube.c +++ b/plugins/cube.cpp diff --git a/plugins/dbus.c b/plugins/dbus.cpp index 704d59d..704d59d 100644 --- a/plugins/dbus.c +++ b/plugins/dbus.cpp diff --git a/plugins/decoration.c b/plugins/decoration.cpp index 76c50e0..20d530e 100644 --- a/plugins/decoration.c +++ b/plugins/decoration.cpp @@ -245,7 +245,7 @@ decorGetTexture (CompScreen *screen, } } - texture = malloc (sizeof (DecorTexture)); + texture = (DecorTexture *) malloc (sizeof (DecorTexture)); if (!texture) return NULL; @@ -429,7 +429,7 @@ decorCreateDecoration (CompScreen *screen, nQuad = (n - BASE_PROP_SIZE) / QUAD_PROP_SIZE; - quad = malloc (sizeof (decor_quad_t) * nQuad); + quad = (decor_quad_t *) malloc (sizeof (decor_quad_t) * nQuad); if (!quad) { XFree (data); @@ -453,7 +453,7 @@ decorCreateDecoration (CompScreen *screen, return NULL; } - decoration = malloc (sizeof (Decoration)); + decoration = (Decoration *) malloc (sizeof (Decoration)); if (!decoration) { free (quad); @@ -550,7 +550,7 @@ createWindowDecoration (Decoration *d) { WindowDecoration *wd; - wd = malloc (sizeof (WindowDecoration) + + wd = (WindowDecoration *) malloc (sizeof (WindowDecoration) + sizeof (ScaledQuad) * d->nQuad); if (!wd) return NULL; @@ -1361,7 +1361,7 @@ decorInitCore (CompPlugin *p, if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; - dc = malloc (sizeof (DecorCore)); + dc = (DecorCore *) malloc (sizeof (DecorCore)); if (!dc) return FALSE; @@ -1412,7 +1412,7 @@ decorInitDisplay (CompPlugin *p, { DecorDisplay *dd; - dd = malloc (sizeof (DecorDisplay)); + dd = (DecorDisplay *) malloc (sizeof (DecorDisplay)); if (!dd) return FALSE; @@ -1479,7 +1479,7 @@ decorInitScreen (CompPlugin *p, DECOR_DISPLAY (s->display); - ds = malloc (sizeof (DecorScreen)); + ds = (DecorScreen *) malloc (sizeof (DecorScreen)); if (!ds) return FALSE; @@ -1543,7 +1543,7 @@ decorInitWindow (CompPlugin *p, DECOR_SCREEN (w->screen); - dw = malloc (sizeof (DecorWindow)); + dw = (DecorWindow *) malloc (sizeof (DecorWindow)); if (!dw) return FALSE; @@ -1623,7 +1623,7 @@ decorGetObjectOptions (CompPlugin *plugin, }; RETURN_DISPATCH (object, dispTab, ARRAY_SIZE (dispTab), - (void *) (*count = 0), (plugin, object, count)); + (CompOption *) (*count = 0), (plugin, object, count)); } static CompBool diff --git a/plugins/fade.c b/plugins/fade.cpp index 7412e57..7412e57 100644 --- a/plugins/fade.c +++ b/plugins/fade.cpp diff --git a/plugins/fuse.c b/plugins/fuse.cpp index 9c6c1d3..9c6c1d3 100644 --- a/plugins/fuse.c +++ b/plugins/fuse.cpp diff --git a/plugins/gconf.c b/plugins/gconf.cpp index 8d365e0..767bd68 100644 --- a/plugins/gconf.c +++ b/plugins/gconf.cpp @@ -410,7 +410,7 @@ gconfReadOptionValue (CompObject *object, if (n) { - value->list.value = malloc (sizeof (CompOptionValue) * n); + value->list.value = (CompOptionValue *) malloc (sizeof (CompOptionValue) * n); if (value->list.value) { for (i = 0; i < n; i++) @@ -721,7 +721,7 @@ gconfInitCore (CompPlugin *p, if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; - gc = malloc (sizeof (GConfCore)); + gc = (GConfCore *) malloc (sizeof (GConfCore)); if (!gc) return FALSE; diff --git a/plugins/glib.c b/plugins/glib.cpp index 2ac0069..6b59b8b 100644 --- a/plugins/glib.c +++ b/plugins/glib.cpp @@ -133,7 +133,7 @@ glibPrepare (CompDisplay *display, if (gd->fds) free (gd->fds); - gd->fds = malloc ((sizeof (GPollFD) + sizeof (GLibWatch)) * nFds); + gd->fds = (GPollFD *) malloc ((sizeof (GPollFD) + sizeof (GLibWatch)) * nFds); if (!gd->fds) { nFds = 0; @@ -195,7 +195,7 @@ glibInitDisplay (CompPlugin *p, if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; - gd = malloc (sizeof (GLibDisplay)); + gd = (GLibDisplay *) malloc (sizeof (GLibDisplay)); if (!gd) return FALSE; diff --git a/plugins/ini.c b/plugins/ini.cpp index 8e90c98..8e90c98 100644 --- a/plugins/ini.c +++ b/plugins/ini.cpp diff --git a/plugins/inotify.c b/plugins/inotify.cpp index 58bff1b..58bff1b 100644 --- a/plugins/inotify.c +++ b/plugins/inotify.cpp diff --git a/plugins/minimize.c b/plugins/minimize.cpp index eb82370..eb82370 100644 --- a/plugins/minimize.c +++ b/plugins/minimize.cpp diff --git a/plugins/move.c b/plugins/move.cpp index 214c25e..37af8d0 100644 --- a/plugins/move.c +++ b/plugins/move.cpp @@ -826,7 +826,7 @@ moveInitDisplay (CompPlugin *p, if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; - md = malloc (sizeof (MoveDisplay)); + md = (MoveDisplay *) malloc (sizeof (MoveDisplay)); if (!md) return FALSE; @@ -890,7 +890,7 @@ moveInitScreen (CompPlugin *p, MOVE_DISPLAY (s->display); - ms = malloc (sizeof (MoveScreen)); + ms = (MoveScreen *) malloc (sizeof (MoveScreen)); if (!ms) return FALSE; @@ -956,7 +956,7 @@ moveGetObjectOptions (CompPlugin *plugin, }; RETURN_DISPATCH (object, dispTab, ARRAY_SIZE (dispTab), - (void *) (*count = 0), (plugin, object, count)); + (CompOption *) (*count = 0), (plugin, object, count)); } static CompBool diff --git a/plugins/place.c b/plugins/place.cpp index c74348f..c74348f 100644 --- a/plugins/place.c +++ b/plugins/place.cpp diff --git a/plugins/png.c b/plugins/png.cpp index 741cf01..741cf01 100644 --- a/plugins/png.c +++ b/plugins/png.cpp diff --git a/plugins/regex.c b/plugins/regex.cpp index b926b2a..b926b2a 100644 --- a/plugins/regex.c +++ b/plugins/regex.cpp diff --git a/plugins/resize.c b/plugins/resize.cpp index c7712b6..b123ded 100644 --- a/plugins/resize.c +++ b/plugins/resize.cpp @@ -1223,7 +1223,7 @@ resizeInitDisplay (CompPlugin *p, if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; - rd = malloc (sizeof (ResizeDisplay)); + rd = (ResizeDisplay *) malloc (sizeof (ResizeDisplay)); if (!rd) return FALSE; @@ -1288,7 +1288,7 @@ resizeInitScreen (CompPlugin *p, RESIZE_DISPLAY (s->display); - rs = malloc (sizeof (ResizeScreen)); + rs = (ResizeScreen *) malloc (sizeof (ResizeScreen)); if (!rs) return FALSE; @@ -1395,7 +1395,7 @@ resizeGetObjectOptions (CompPlugin *plugin, }; RETURN_DISPATCH (object, dispTab, ARRAY_SIZE (dispTab), - (void *) (*count = 0), (plugin, object, count)); + (CompOption *) (*count = 0), (plugin, object, count)); } static CompBool diff --git a/plugins/rotate.c b/plugins/rotate.cpp index 09e05f9..09e05f9 100644 --- a/plugins/rotate.c +++ b/plugins/rotate.cpp diff --git a/plugins/scale.c b/plugins/scale.cpp index 5b4df25..5b4df25 100644 --- a/plugins/scale.c +++ b/plugins/scale.cpp diff --git a/plugins/screenshot.c b/plugins/screenshot.cpp index b66b9f8..b66b9f8 100644 --- a/plugins/screenshot.c +++ b/plugins/screenshot.cpp diff --git a/plugins/svg.c b/plugins/svg.cpp index bd39174..bd39174 100644 --- a/plugins/svg.c +++ b/plugins/svg.cpp diff --git a/plugins/switcher.c b/plugins/switcher.cpp index 3cb9c0e..3cb9c0e 100644 --- a/plugins/switcher.c +++ b/plugins/switcher.cpp diff --git a/plugins/video.c b/plugins/video.cpp index 4268d00..4268d00 100644 --- a/plugins/video.c +++ b/plugins/video.cpp diff --git a/plugins/water.c b/plugins/water.cpp index b8bd349..b8bd349 100644 --- a/plugins/water.c +++ b/plugins/water.cpp diff --git a/plugins/wobbly.c b/plugins/wobbly.cpp index d05c983..d05c983 100644 --- a/plugins/wobbly.c +++ b/plugins/wobbly.cpp diff --git a/plugins/zoom.c b/plugins/zoom.cpp index 8996c1c..c3c327a 100644 --- a/plugins/zoom.c +++ b/plugins/zoom.cpp @@ -973,7 +973,7 @@ zoomInitDisplay (CompPlugin *p, if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; - zd = malloc (sizeof (ZoomDisplay)); + zd = (ZoomDisplay *) malloc (sizeof (ZoomDisplay)); if (!zd) return FALSE; @@ -1032,7 +1032,7 @@ zoomInitScreen (CompPlugin *p, ZOOM_DISPLAY (s->display); - zs = malloc (sizeof (ZoomScreen)); + zs = (ZoomScreen *) malloc (sizeof (ZoomScreen)); if (!zs) return FALSE; @@ -1129,7 +1129,7 @@ zoomGetObjectOptions (CompPlugin *plugin, }; RETURN_DISPATCH (object, dispTab, ARRAY_SIZE (dispTab), - (void *) (*count = 0), (plugin, object, count)); + (CompOption *) (*count = 0), (plugin, object, count)); } static CompBool diff --git a/src/Makefile.am b/src/Makefile.am index 683d695..ee74639 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,21 +12,21 @@ bin_PROGRAMS = compiz compiz_LDADD = @COMPIZ_LIBS@ @GL_LIBS@ -lm compiz_LDFLAGS = -export-dynamic compiz_SOURCES = \ - main.c \ - privates.c \ - object.c \ - core.c \ - texture.c \ - display.c \ - screen.c \ - window.c \ - event.c \ - paint.c \ - option.c \ - plugin.c \ - session.c \ - fragment.c \ - matrix.c \ - cursor.c \ - match.c \ - metadata.c + main.cpp \ + privates.cpp \ + object.cpp \ + core.cpp \ + texture.cpp \ + display.cpp \ + screen.cpp \ + window.cpp \ + event.cpp \ + paint.cpp \ + option.cpp \ + plugin.cpp \ + session.cpp \ + fragment.cpp \ + matrix.cpp \ + cursor.cpp \ + match.cpp \ + metadata.cpp diff --git a/src/action.c b/src/action.cpp index ebcd37e..ebcd37e 100644 --- a/src/action.c +++ b/src/action.cpp diff --git a/src/core.c b/src/core.cpp index a79854b..5e6f893 100644 --- a/src/core.c +++ b/src/core.cpp @@ -253,7 +253,7 @@ addFileWatch (const char *path, { CompFileWatch *fileWatch; - fileWatch = malloc (sizeof (CompFileWatch)); + fileWatch = (CompFileWatch *) malloc (sizeof (CompFileWatch)); if (!fileWatch) return 0; diff --git a/src/cursor.c b/src/cursor.cpp index 559a285..baca1c3 100644 --- a/src/cursor.c +++ b/src/cursor.cpp @@ -40,7 +40,7 @@ addCursor (CompScreen *s) { CompCursor *c; - c = malloc (sizeof (CompCursor)); + c = (CompCursor *) malloc (sizeof (CompCursor)); if (c) { c->screen = s; @@ -127,7 +127,7 @@ updateCursor (CompCursor *c, if (!image) return; - cursorImage = malloc (sizeof (CompCursorImage)); + cursorImage = (CompCursorImage *) malloc (sizeof (CompCursorImage)); if (!cursorImage) { XFree (image); diff --git a/src/display.c b/src/display.cpp index 10cde37..09223fb 100644 --- a/src/display.c +++ b/src/display.cpp @@ -780,7 +780,7 @@ setAudibleBell (CompDisplay *display, static Bool pingTimeout (void *closure) { - CompDisplay *d = closure; + CompDisplay *d = (CompDisplay *) closure; CompScreen *s; CompWindow *w; XEvent ev; @@ -946,7 +946,7 @@ updatePlugins (CompDisplay *d) if (nPop) { - pop = malloc (sizeof (CompPlugin *) * nPop); + pop = (CompPlugin **) malloc (sizeof (CompPlugin *) * nPop); if (!pop) { (*core.setOptionForPlugin) (&d->base, "core", o->name, &d->plugin); @@ -995,7 +995,7 @@ updatePlugins (CompDisplay *d) { CompOptionValue *value; - value = realloc (d->plugin.list.value, sizeof (CompOptionValue) * + value = (CompOptionValue *) realloc (d->plugin.list.value, sizeof (CompOptionValue) * (d->plugin.list.nValue + 1)); if (value) { @@ -1055,7 +1055,7 @@ compAddTimeout (int minTime, { CompTimeout *timeout; - timeout = malloc (sizeof (CompTimeout)); + timeout = (CompTimeout *) malloc (sizeof (CompTimeout)); if (!timeout) return 0; @@ -1110,7 +1110,7 @@ compAddWatchFd (int fd, { CompWatchFd *watchFd; - watchFd = malloc (sizeof (CompWatchFd)); + watchFd = (CompWatchFd *) malloc (sizeof (CompWatchFd)); if (!watchFd) return 0; @@ -1127,7 +1127,7 @@ compAddWatchFd (int fd, core.nWatchFds++; - core.watchPollFds = realloc (core.watchPollFds, + core.watchPollFds = (struct pollfd *) realloc (core.watchPollFds, core.nWatchFds * sizeof (struct pollfd)); core.watchPollFds[core.nWatchFds - 1].fd = fd; @@ -2002,13 +2002,13 @@ addDisplay (const char *name) int xkbOpcode; int firstScreen, lastScreen; - d = malloc (sizeof (CompDisplay)); + d = (CompDisplay *) malloc (sizeof (CompDisplay)); if (!d) return FALSE; if (displayPrivateLen) { - privates = malloc (displayPrivateLen * sizeof (CompPrivate)); + privates = (CompPrivate *) malloc (displayPrivateLen * sizeof (CompPrivate)); if (!privates) { free (d); @@ -2043,7 +2043,7 @@ addDisplay (const char *name) d->plugin.list.type = CompOptionTypeString; d->plugin.list.nValue = 1; - d->plugin.list.value = malloc (sizeof (CompOptionValue)); + d->plugin.list.value = (CompOptionValue *) malloc (sizeof (CompOptionValue)); if (!d->plugin.list.value) { free (d); @@ -2075,7 +2075,7 @@ addDisplay (const char *name) return FALSE; } - d->connection = XGetXCBConnection (dpy); + // d->connection = XGetXCBConnection (dpy); if (!compInitDisplayOptionsFromMetadata (d, &coreMetadata, @@ -2984,7 +2984,7 @@ readImageFromFile (CompDisplay *display, { char *path; - path = malloc (strlen (home) + strlen (HOME_IMAGEDIR) + 2); + path = (char *) malloc (strlen (home) + strlen (HOME_IMAGEDIR) + 2); if (path) { sprintf (path, "%s/%s", home, HOME_IMAGEDIR); diff --git a/src/event.c b/src/event.cpp index 31055b0..ea4e781 100644 --- a/src/event.c +++ b/src/event.cpp @@ -184,7 +184,7 @@ moveInputFocusToOtherWindow (CompWindow *w) static Bool autoRaiseTimeout (void *closure) { - CompDisplay *display = closure; + CompDisplay *display = (CompDisplay *) closure; CompWindow *w = findWindowAtDisplay (display, display->activeWindow); if (display->autoRaiseWindow == display->activeWindow || @@ -765,7 +765,7 @@ triggerEdgeEnter (CompDisplay *d, if (delay > 0) { - delayedSettings = malloc (sizeof (CompDelayedEdgeSettings)); + delayedSettings = (CompDelayedEdgeSettings *) malloc (sizeof (CompDelayedEdgeSettings)); if (delayedSettings) { delayedSettings->d = d; @@ -1255,7 +1255,7 @@ handleEvent (CompDisplay *d, if (s->nExpose == s->sizeExpose) { - s->exposeRects = realloc (s->exposeRects, + s->exposeRects = (XRectangle *) realloc (s->exposeRects, (s->sizeExpose + more) * sizeof (XRectangle)); s->sizeExpose += more; @@ -2234,7 +2234,7 @@ handleEvent (CompDisplay *d, { if (w->nDamage == w->sizeDamage) { - w->damageRects = realloc (w->damageRects, + w->damageRects = (XRectangle *) realloc (w->damageRects, (w->sizeDamage + 1) * sizeof (XRectangle)); w->sizeDamage += 1; diff --git a/src/fragment.c b/src/fragment.cpp index dda806c..99c38cc 100644 --- a/src/fragment.c +++ b/src/fragment.cpp @@ -516,7 +516,7 @@ addFetchOffsetVariables (CompDataOp *op, newSize = oldSize + strlen (data); - str = realloc (info->data, newSize + 1); + str = (char *) realloc (info->data, newSize + 1); if (str) { strcpy (str + oldSize, data); @@ -538,7 +538,7 @@ addData (CompDataOp *op, int oldSize = strlen (info->data); int newSize = oldSize + strlen (op->data); - str = realloc (info->data, newSize + 1); + str = (char *) realloc (info->data, newSize + 1); if (str) { strcpy (str + oldSize, op->data); @@ -559,11 +559,11 @@ buildFragmentProgram (CompScreen *s, FetchInfo info; int i; - program = malloc (sizeof (CompProgram)); + program = (CompProgram *) malloc (sizeof (CompProgram)); if (!program) return NULL; - functionList = malloc ((attrib->nFunction + 1) * sizeof (void *)); + functionList = (CompFunction **) malloc ((attrib->nFunction + 1) * sizeof (void *)); if (!functionList) { free (program); @@ -600,7 +600,7 @@ buildFragmentProgram (CompScreen *s, return NULL; } - program->signature = malloc (attrib->nFunction * sizeof (int)); + program->signature = (int *) malloc (attrib->nFunction * sizeof (int)); if (!program->signature) { free (program); @@ -692,7 +692,7 @@ createFunctionData (void) { CompFunctionData *data; - data = malloc (sizeof (CompFunctionData)); + data = (CompFunctionData *) malloc (sizeof (CompFunctionData)); if (!data) return NULL; @@ -781,7 +781,7 @@ copyData (CompHeaderOp *header, } /* allocate new memory that will fit all substitutions */ - copy = malloc (strlen (data) + count * (strlen (prefix) + 1) + 1); + copy = (char *) malloc (strlen (data) + count * (strlen (prefix) + 1) + 1); if (!copy) return NULL; @@ -840,11 +840,11 @@ copyFunctionData (CompFunctionData *dst, { int i; - dst->header = malloc (src->nHeader * sizeof (CompHeaderOp)); + dst->header = (CompHeaderOp *) malloc (src->nHeader * sizeof (CompHeaderOp)); if (!dst->header) return FALSE; - dst->body = malloc (src->nBody * sizeof (CompBodyOp)); + dst->body = (CompBodyOp *) malloc (src->nBody * sizeof (CompBodyOp)); if (!dst->body) { free (dst->header); @@ -939,7 +939,7 @@ addHeaderOpToFunctionData (CompFunctionData *data, } } - header = realloc (data->header, + header = (CompHeaderOp *) realloc (data->header, (data->nHeader + 1) * sizeof (CompHeaderOp)); if (!header) return FALSE; @@ -979,7 +979,7 @@ allocBodyOpInFunctionData (CompFunctionData *data) { CompBodyOp *body; - body = realloc (data->body, (data->nBody + 1) * sizeof (CompBodyOp)); + body = (CompBodyOp *) realloc (data->body, (data->nBody + 1) * sizeof (CompBodyOp)); if (!body) return FALSE; @@ -1044,7 +1044,7 @@ addDataOpToFunctionData (CompFunctionData *data, if (!allocBodyOpInFunctionData (data)) return FALSE; - fStr = malloc (size); + fStr = (char *) malloc (size); if (!fStr) return FALSE; @@ -1065,7 +1065,7 @@ addDataOpToFunctionData (CompFunctionData *data, else /* glibc 2.0 */ size++; /* one more than the old size */ - tmp = realloc (fStr, size); + tmp = (char *) realloc (fStr, size); if (!tmp) { free (fStr); @@ -1098,7 +1098,7 @@ addBlendOpToFunctionData (CompFunctionData *data, if (!allocBodyOpInFunctionData (data)) return FALSE; - fStr = malloc (size); + fStr = (char *) malloc (size); if (!fStr) return FALSE; @@ -1119,7 +1119,7 @@ addBlendOpToFunctionData (CompFunctionData *data, else /* glibc 2.0 */ size++; /* one more than the old size */ - tmp = realloc (fStr, size); + tmp = (char *) realloc (fStr, size); if (!tmp) { free (fStr); @@ -1157,7 +1157,7 @@ createFragmentFunction (CompScreen *s, { if (!nameBuffer) { - nameBuffer = malloc (strlen (name) + 64); + nameBuffer = (char *) malloc (strlen (name) + 64); if (!nameBuffer) return 0; @@ -1167,7 +1167,7 @@ createFragmentFunction (CompScreen *s, sprintf (nameBuffer, "%s%d", name, i++); } - function = malloc (sizeof (CompFunction)); + function = (CompFunction *) malloc (sizeof (CompFunction)); if (!function) { if (nameBuffer) diff --git a/src/main.c b/src/main.cpp index f4e3381..6ca3bb4 100644 --- a/src/main.c +++ b/src/main.cpp @@ -373,7 +373,7 @@ main (int argc, char **argv) if (refreshRateArg) { - ctx.refreshRateData = malloc (strlen (refreshRateArg) + 256); + ctx.refreshRateData = (char *) malloc (strlen (refreshRateArg) + 256); if (ctx.refreshRateData) sprintf (ctx.refreshRateData, "<min>1</min><default>%s</default>", @@ -387,7 +387,7 @@ main (int argc, char **argv) for (i = 0; i < nPlugin; i++) size += strlen (plugin[i]) + 16; - ctx.pluginData = malloc (size); + ctx.pluginData = (char *) malloc (size); if (ctx.pluginData) { char *ptr = ctx.pluginData; diff --git a/src/match.c b/src/match.cpp index 26b3eb8..935ec50 100644 --- a/src/match.c +++ b/src/match.cpp @@ -157,7 +157,7 @@ matchAddOp (CompMatch *match, if (!match->nOp) flags &= ~MATCH_OP_AND_MASK; - op = realloc (match->op, sizeof (CompMatchOp) * (match->nOp + 1)); + op = (CompMatchOp *) realloc (match->op, sizeof (CompMatchOp) * (match->nOp + 1)); if (!op) return FALSE; @@ -185,7 +185,7 @@ matchCopyOps (CompMatchOp *opDst, switch (opSrc->type) { case CompMatchOpTypeGroup: - op = malloc (sizeof (CompMatchOp) * opSrc->group.nOp); + op = (CompMatchOp *) malloc (sizeof (CompMatchOp) * opSrc->group.nOp); if (!op) { matchFiniOps (first, count); @@ -230,7 +230,7 @@ matchCopy (CompMatch *dst, { CompMatchOp *opDst; - opDst = malloc (sizeof (CompMatchOp) * src->nOp); + opDst = (CompMatchOp *) malloc (sizeof (CompMatchOp) * src->nOp); if (!opDst) return FALSE; @@ -253,7 +253,7 @@ matchAddGroup (CompMatch *match, { CompMatchOp *op, *opDst; - opDst = malloc (sizeof (CompMatchOp) * group->nOp); + opDst = (CompMatchOp *) malloc (sizeof (CompMatchOp) * group->nOp); if (!opDst) return FALSE; @@ -321,7 +321,7 @@ strndupValue (const char *str, { char *value; - value = malloc (sizeof (char) * (n + 1)); + value = (char *) malloc (sizeof (char) * (n + 1)); if (value) { int i, j; @@ -422,7 +422,7 @@ matchAddFromString (CompMatch *match, length = j - i; - value = malloc (sizeof (char) * (length + 1)); + value = (char *) malloc (sizeof (char) * (length + 1)); if (value) { CompMatch group; @@ -486,7 +486,7 @@ matchOpsToString (CompMatchOp *op, group = matchOpsToString (op->group.op, op->group.nOp); if (group) { - value = malloc (sizeof (char) * (strlen (group) + 7)); + value = (char *) malloc (sizeof (char) * (strlen (group) + 7)); if (value) sprintf (value, "%s%s(%s)%s", !str ? "" : ((op->any.flags & MATCH_OP_AND_MASK) ? @@ -498,7 +498,7 @@ matchOpsToString (CompMatchOp *op, } break; case CompMatchOpTypeExp: - value = malloc (sizeof (char) * (strlen (op->exp.value) + 5)); + value = (char *) malloc (sizeof (char) * (strlen (op->exp.value) + 5)); if (value) sprintf (value, "%s%s%s%s", !str ? "" : ((op->any.flags & MATCH_OP_AND_MASK) ? "& " : "| "), @@ -512,7 +512,7 @@ matchOpsToString (CompMatchOp *op, char *s; int valueLength = strlen (value); - s = malloc (sizeof (char) * (length + valueLength + 1)); + s = (char *) malloc (sizeof (char) * (length + valueLength + 1)); if (s) { if (str) @@ -641,35 +641,35 @@ matchEval (CompMatch *match, static Bool matchEvalTypeExp (CompDisplay *display, CompWindow *window, - CompPrivate private) + CompPrivate c_private) { - return (private.uval & window->wmType); + return (c_private.uval & window->wmType); } static Bool matchEvalStateExp (CompDisplay *display, CompWindow *window, - CompPrivate private) + CompPrivate c_private) { - return (private.uval & window->state); + return (c_private.uval & window->state); } static Bool matchEvalIdExp (CompDisplay *display, CompWindow *window, - CompPrivate private) + CompPrivate c_private) { - return (private.val == window->id); + return (c_private.val == window->id); } static Bool matchEvalOverrideRedirectExp (CompDisplay *display, CompWindow *window, - CompPrivate private) + CompPrivate c_private) { Bool overrideRedirect = window->attrib.override_redirect; - return ((private.val == 1 && overrideRedirect) || - (private.val == 0 && !overrideRedirect)); + return ((c_private.val == 1 && overrideRedirect) || + (c_private.val == 0 && !overrideRedirect)); } void diff --git a/src/matrix.c b/src/matrix.cpp index 8430f02..8430f02 100644 --- a/src/matrix.c +++ b/src/matrix.cpp diff --git a/src/metadata.c b/src/metadata.cpp index 191edaa..5e7d365 100644 --- a/src/metadata.c +++ b/src/metadata.cpp @@ -92,7 +92,7 @@ readXmlFile (const char *path, if (path) length += strlen (path) + 1; - file = malloc (length); + file = (char *) malloc (length); if (!file) return NULL; @@ -128,7 +128,7 @@ addMetadataFromFilename (CompMetadata *metadata, if (!doc) return FALSE; - d = realloc (metadata->doc, (metadata->nDoc + 1) * sizeof (xmlDoc *)); + d = (xmlDoc **) realloc (metadata->doc, (metadata->nDoc + 1) * sizeof (xmlDoc *)); if (!d) { xmlFreeDoc (doc); @@ -153,7 +153,7 @@ compAddMetadataFromFile (CompMetadata *metadata, { char *path; - path = malloc (strlen (home) + strlen (HOME_METADATADIR) + 2); + path = (char *) malloc (strlen (home) + strlen (HOME_METADATADIR) + 2); if (path) { sprintf (path, "%s/%s", home, HOME_METADATADIR); @@ -190,7 +190,7 @@ compAddMetadataFromString (CompMetadata *metadata, return FALSE; } - d = realloc (metadata->doc, (metadata->nDoc + 1) * sizeof (xmlDoc *)); + d = (xmlDoc **) realloc (metadata->doc, (metadata->nDoc + 1) * sizeof (xmlDoc *)); if (!d) { xmlFreeDoc (doc); @@ -220,7 +220,7 @@ compAddMetadataFromIO (CompMetadata *metadata, return FALSE; } - d = realloc (metadata->doc, (metadata->nDoc + 1) * sizeof (xmlDoc *)); + d = (xmlDoc **) realloc (metadata->doc, (metadata->nDoc + 1) * sizeof (xmlDoc *)); if (!d) { xmlFreeDoc (doc); @@ -755,7 +755,7 @@ initListValue (CompDisplay *d, if (xmlStrcmp (child->name, BAD_CAST "value")) continue; - value = realloc (v->list.value, + value = (CompOptionValue *) realloc (v->list.value, sizeof (CompOptionValue) * (v->list.nValue + 1)); if (value) { diff --git a/src/object.c b/src/object.cpp index e9717c6..e9717c6 100644 --- a/src/object.c +++ b/src/object.cpp diff --git a/src/option.c b/src/option.cpp index bbc15fd..1c704fc 100644 --- a/src/option.c +++ b/src/option.cpp @@ -323,7 +323,7 @@ compSetOptionList (CompOption *option, { CompOptionValue *v; - v = malloc (sizeof (CompOptionValue) * value->list.nValue); + v = (CompOptionValue *) malloc (sizeof (CompOptionValue) * value->list.nValue); if (!v) return FALSE; @@ -543,7 +543,7 @@ stringAppend (char *s, if (s) len += strlen (s); - r = malloc (len + 1); + r = (char *) malloc (len + 1); if (r) { if (s) diff --git a/src/paint.c b/src/paint.cpp index a2051fa..30b492e 100644 --- a/src/paint.c +++ b/src/paint.cpp @@ -177,7 +177,7 @@ paintBackground (CompScreen *s, s->backgroundLoaded = TRUE; } - data = malloc (sizeof (GLfloat) * nBox * 16); + data = (GLfloat *) malloc (sizeof (GLfloat) * nBox * 16); if (!data) return; @@ -643,7 +643,7 @@ moreWindowVertices (CompWindow *w, { GLfloat *vertices; - vertices = realloc (w->vertices, sizeof (GLfloat) * newSize); + vertices = (GLfloat *) realloc (w->vertices, sizeof (GLfloat) * newSize); if (!vertices) return FALSE; @@ -662,7 +662,7 @@ moreWindowIndices (CompWindow *w, { GLushort *indices; - indices = realloc (w->indices, sizeof (GLushort) * newSize); + indices = (GLushort *) realloc (w->indices, sizeof (GLushort) * newSize); if (!indices) return FALSE; diff --git a/src/plugin.c b/src/plugin.cpp index 7b7a010..d545240 100644 --- a/src/plugin.c +++ b/src/plugin.cpp @@ -62,7 +62,7 @@ coreGetObjectOptions (CompPlugin *plugin, }; RETURN_DISPATCH (object, dispTab, ARRAY_SIZE (dispTab), - (void *) (*count = 0), (plugin, object, count)); + (CompOption *) (*count = 0), (plugin, object, count)); } static Bool @@ -124,7 +124,7 @@ cloaderListPlugins (const char *path, if (path) return 0; - list = malloc (sizeof (char *)); + list = (char **) malloc (sizeof (char *)); if (!list) return 0; @@ -148,7 +148,7 @@ dlloaderLoadPlugin (CompPlugin *p, char *file; void *dlhand; - file = malloc ((path ? strlen (path) : 0) + strlen (name) + 8); + file = (char *) malloc ((path ? strlen (path) : 0) + strlen (name) + 8); if (!file) return FALSE; @@ -259,7 +259,7 @@ dlloaderListPlugins (const char *path, if (!nFile) return cList; - list = realloc (cList, (j + nFile) * sizeof (char *)); + list = (char **) realloc (cList, (j + nFile) * sizeof (char *)); if (!list) return cList; @@ -267,7 +267,7 @@ dlloaderListPlugins (const char *path, { length = strlen (nameList[i]->d_name); - name = malloc ((length - 5) * sizeof (char)); + name = (char *) malloc ((length - 5) * sizeof (char)); if (name) { strncpy (name, nameList[i]->d_name + 3, length - 6); @@ -543,7 +543,7 @@ loadPlugin (const char *name) char *home, *plugindir; Bool status; - p = malloc (sizeof (CompPlugin)); + p = (CompPlugin *) malloc (sizeof (CompPlugin)); if (!p) return 0; @@ -555,7 +555,7 @@ loadPlugin (const char *name) home = getenv ("HOME"); if (home) { - plugindir = malloc (strlen (home) + strlen (HOME_PLUGINDIR) + 3); + plugindir = (char *) malloc (strlen (home) + strlen (HOME_PLUGINDIR) + 3); if (plugindir) { sprintf (plugindir, "%s/%s", home, HOME_PLUGINDIR); @@ -654,7 +654,7 @@ availablePlugins (int *n) home = getenv ("HOME"); if (home) { - plugindir = malloc (strlen (home) + strlen (HOME_PLUGINDIR) + 3); + plugindir = (char *) malloc (strlen (home) + strlen (HOME_PLUGINDIR) + 3); if (plugindir) { sprintf (plugindir, "%s/%s", home, HOME_PLUGINDIR); @@ -677,7 +677,7 @@ availablePlugins (int *n) if (!count) return NULL; - list = malloc (count * sizeof (char *)); + list = (char **) malloc (count * sizeof (char *)); if (!list) return NULL; diff --git a/src/privates.c b/src/privates.cpp index 56baa4b..56baa4b 100644 --- a/src/privates.c +++ b/src/privates.cpp diff --git a/src/screen.c b/src/screen.cpp index 15d1fd0..c1b8594 100644 --- a/src/screen.c +++ b/src/screen.cpp @@ -186,7 +186,7 @@ setDesktopHints (CompScreen *s) size = s->nDesktop * 2 + s->nDesktop * 2 + s->nDesktop * 4 + 1; - data = malloc (sizeof (unsigned long) * size); + data = (unsigned long *) malloc (sizeof (unsigned long) * size); if (!data) return; @@ -306,7 +306,7 @@ updateOutputDevices (CompScreen *s) if (x1 < x2 && y1 < y2) { - o = realloc (output, sizeof (CompOutput) * (nOutput + 1)); + o = (CompOutput *) realloc (output, sizeof (CompOutput) * (nOutput + 1)); if (o) { o[nOutput].region.extents.x1 = x1; @@ -323,7 +323,7 @@ updateOutputDevices (CompScreen *s) /* make sure we have at least one output */ if (!nOutput) { - output = malloc (sizeof (CompOutput)); + output = (CompOutput *) malloc (sizeof (CompOutput)); if (!output) return; @@ -338,7 +338,7 @@ updateOutputDevices (CompScreen *s) /* set name, width, height and update rect pointers in all regions */ for (i = 0; i < nOutput; i++) { - output[i].name = malloc (sizeof (char) * 10); + output[i].name = (char *) malloc (sizeof (char) * 10); if (output[i].name) snprintf (output[i].name, 10, "Output %d", nOutput); @@ -448,7 +448,7 @@ detectOutputDevices (CompScreen *s) int n = s->display->nScreenInfo; value.list.nValue = n; - value.list.value = malloc (sizeof (CompOptionValue) * n); + value.list.value = (CompOptionValue *) malloc (sizeof (CompOptionValue) * n); if (!value.list.value) return; @@ -466,7 +466,7 @@ detectOutputDevices (CompScreen *s) else { value.list.nValue = 1; - value.list.value = malloc (sizeof (CompOptionValue)); + value.list.value = (CompOptionValue *) malloc (sizeof (CompOptionValue)); if (!value.list.value) return; @@ -683,7 +683,7 @@ updateStartupFeedback (CompScreen *s) static Bool startupSequenceTimeout (void *data) { - CompScreen *screen = data; + CompScreen *screen = (CompScreen *) data; CompStartupSequence *s; struct timeval now, active; double elapsed; @@ -712,7 +712,7 @@ addSequence (CompScreen *screen, { CompStartupSequence *s; - s = malloc (sizeof (CompStartupSequence)); + s = (CompStartupSequence *) malloc (sizeof (CompStartupSequence)); if (!s) return; @@ -772,7 +772,7 @@ static void compScreenSnEvent (SnMonitorEvent *event, void *userData) { - CompScreen *screen = userData; + CompScreen *screen = (CompScreen *) userData; SnStartupSequence *sequence; sequence = sn_monitor_event_get_startup_sequence (event); @@ -1637,7 +1637,7 @@ addScreen (CompDisplay *display, GLfloat light0Position[] = { -0.5f, 0.5f, -9.0f, 1.0f }; CompWindow *w; - s = malloc (sizeof (CompScreen)); + s = (CompScreen *) malloc (sizeof (CompScreen)); if (!s) return FALSE; @@ -1646,7 +1646,7 @@ addScreen (CompDisplay *display, if (display->screenPrivateLen) { - privates = malloc (display->screenPrivateLen * sizeof (CompPrivate)); + privates = (CompPrivate *) malloc (display->screenPrivateLen * sizeof (CompPrivate)); if (!privates) { free (s); @@ -2544,7 +2544,7 @@ findTopLevelWindowAtScreen (CompScreen *s, if (w->attrib.override_redirect) { /* likely a frame window */ - if (w->attrib.class == InputOnly) + if (w->attrib.c_class == InputOnly) { for (w = s->windows; w; w = w->next) if (w->frame == id) @@ -2700,7 +2700,7 @@ pushScreenGrab (CompScreen *s, if (s->grabSize <= s->maxGrab) { - s->grabs = realloc (s->grabs, sizeof (CompGrab) * (s->maxGrab + 1)); + s->grabs = (CompGrab *) realloc (s->grabs, sizeof (CompGrab) * (s->maxGrab + 1)); if (!s->grabs) return 0; @@ -2910,7 +2910,7 @@ addPassiveKeyGrab (CompScreen *s, } } - keyGrab = realloc (s->keyGrab, sizeof (CompKeyGrab) * (s->nKeyGrab + 1)); + keyGrab = (CompKeyGrab *) realloc (s->keyGrab, sizeof (CompKeyGrab) * (s->nKeyGrab + 1)); if (!keyGrab) return FALSE; @@ -2952,7 +2952,7 @@ removePassiveKeyGrab (CompScreen *s, (s->nKeyGrab - (i + 1)) * sizeof (CompKeyGrab)); s->nKeyGrab--; - s->keyGrab = realloc (s->keyGrab, + s->keyGrab = (CompKeyGrab *) realloc (s->keyGrab, sizeof (CompKeyGrab) * s->nKeyGrab); if (!(mask & CompNoMask)) @@ -2995,7 +2995,7 @@ addPassiveButtonGrab (CompScreen *s, } } - buttonGrab = realloc (s->buttonGrab, + buttonGrab = (CompButtonGrab *) realloc (s->buttonGrab, sizeof (CompButtonGrab) * (s->nButtonGrab + 1)); if (!buttonGrab) return FALSE; @@ -3030,7 +3030,7 @@ removePassiveButtonGrab (CompScreen *s, (s->nButtonGrab - (i + 1)) * sizeof (CompButtonGrab)); s->nButtonGrab--; - s->buttonGrab = realloc (s->buttonGrab, + s->buttonGrab = (CompButtonGrab *) realloc (s->buttonGrab, sizeof (CompButtonGrab) * s->nButtonGrab); } } @@ -3321,7 +3321,7 @@ updateClientListForScreen (CompScreen *s) { CompWindow **list; - list = realloc (s->clientList, + list = (CompWindow **) realloc (s->clientList, (sizeof (CompWindow *) + sizeof (Window) * 2) * n); if (!list) return; @@ -3617,7 +3617,7 @@ addGroupToScreen (CompScreen *s, { CompGroup *group; - group = malloc (sizeof (CompGroup)); + group = (CompGroup *) malloc (sizeof (CompGroup)); if (!group) return NULL; @@ -4180,7 +4180,7 @@ updateDefaultIcon (CompScreen *screen) if (!readImageFromFile (screen->display, file, &width, &height, &data)) return FALSE; - icon = malloc (sizeof (CompIcon) + width * height * sizeof (CARD32)); + icon = (CompIcon *) malloc (sizeof (CompIcon) + width * height * sizeof (CARD32)); if (!icon) { free (data); diff --git a/src/session.c b/src/session.cpp index 2ea8f85..28f60cd 100644 --- a/src/session.c +++ b/src/session.cpp @@ -60,7 +60,7 @@ setStringListProperty (SmcConn connection, prop.name = (char *) name; prop.type = SmLISTofARRAY8; - prop.vals = malloc (nValues * sizeof (SmPropValue)); + prop.vals = (SmPropValue *) malloc (nValues * sizeof (SmPropValue)); if (!prop.vals) return; @@ -87,7 +87,7 @@ setCloneRestartCommands (SmcConn connection) /* at maximum, we pass our old arguments + our new client id to the SM, so allocate for that case */ - args = malloc ((programArgc + 2) * sizeof (char *)); + args = (const char **) malloc ((programArgc + 2) * sizeof (char *)); if (!args) return; diff --git a/src/texture.c b/src/texture.cpp index 0002e03..78a838b 100644 --- a/src/texture.c +++ b/src/texture.cpp @@ -102,11 +102,11 @@ imageToTexture (CompScreen *screen, GLenum format, GLenum type) { - char *data; - int i; - GLint internalFormat; + char *data; + unsigned int i; + GLint internalFormat; - data = malloc (4 * width * height); + data = (char *) malloc (4 * width * height); if (!data) return FALSE; @@ -210,7 +210,7 @@ readImageToTexture (CompScreen *screen, &width, &height, &image)) return FALSE; - status = imageBufferToTexture (screen, texture, image, width, height); + status = imageBufferToTexture (screen, texture, (char *)image, width, height); free (image); diff --git a/src/window.c b/src/window.cpp index 78db007..378b10e 100644 --- a/src/window.c +++ b/src/window.cpp @@ -1683,7 +1683,7 @@ updateWindowStruts (CompWindow *w) unsigned long n, left; unsigned char *data; Bool hasOld, hasNew; - CompStruts old, new; + CompStruts old, c_new; #define MIN_EMPTY 76 @@ -1703,25 +1703,25 @@ updateWindowStruts (CompWindow *w) hasNew = FALSE; - new.left.x = 0; - new.left.y = 0; - new.left.width = 0; - new.left.height = w->screen->height; + c_new.left.x = 0; + c_new.left.y = 0; + c_new.left.width = 0; + c_new.left.height = w->screen->height; - new.right.x = w->screen->width; - new.right.y = 0; - new.right.width = 0; - new.right.height = w->screen->height; + c_new.right.x = w->screen->width; + c_new.right.y = 0; + c_new.right.width = 0; + c_new.right.height = w->screen->height; - new.top.x = 0; - new.top.y = 0; - new.top.width = w->screen->width; - new.top.height = 0; + c_new.top.x = 0; + c_new.top.y = 0; + c_new.top.width = w->screen->width; + c_new.top.height = 0; - new.bottom.x = 0; - new.bottom.y = w->screen->height; - new.bottom.width = w->screen->width; - new.bottom.height = 0; + c_new.bottom.x = 0; + c_new.bottom.y = w->screen->height; + c_new.bottom.width = w->screen->width; + c_new.bottom.height = 0; result = XGetWindowProperty (w->screen->display->display, w->id, w->screen->display->wmStrutPartialAtom, @@ -1741,27 +1741,27 @@ updateWindowStruts (CompWindow *w) gap = w->screen->width - struts[0] - struts[1]; gap -= MIN_EMPTY; - new.left.width = (int) struts[0] + MIN (0, gap / 2); - new.right.width = (int) struts[1] + MIN (0, gap / 2); + c_new.left.width = (int) struts[0] + MIN (0, gap / 2); + c_new.right.width = (int) struts[1] + MIN (0, gap / 2); gap = w->screen->height - struts[2] - struts[3]; gap -= MIN_EMPTY; - new.top.height = (int) struts[2] + MIN (0, gap / 2); - new.bottom.height = (int) struts[3] + MIN (0, gap / 2); + c_new.top.height = (int) struts[2] + MIN (0, gap / 2); + c_new.bottom.height = (int) struts[3] + MIN (0, gap / 2); - new.right.x = w->screen->width - new.right.width; - new.bottom.y = w->screen->height - new.bottom.height; + c_new.right.x = w->screen->width - c_new.right.width; + c_new.bottom.y = w->screen->height - c_new.bottom.height; - new.left.y = struts[4]; - new.left.height = struts[5] - new.left.y + 1; - new.right.y = struts[6]; - new.right.height = struts[7] - new.right.y + 1; + c_new.left.y = struts[4]; + c_new.left.height = struts[5] - c_new.left.y + 1; + c_new.right.y = struts[6]; + c_new.right.height = struts[7] - c_new.right.y + 1; - new.top.x = struts[8]; - new.top.width = struts[9] - new.top.x + 1; - new.bottom.x = struts[10]; - new.bottom.width = struts[11] - new.bottom.x + 1; + c_new.top.x = struts[8]; + c_new.top.width = struts[9] - c_new.top.x + 1; + c_new.bottom.x = struts[10]; + c_new.bottom.width = struts[11] - c_new.bottom.x + 1; } XFree (data); @@ -1787,20 +1787,20 @@ updateWindowStruts (CompWindow *w) gap = w->screen->width - struts[0] - struts[1]; gap -= MIN_EMPTY; - new.left.width = (int) struts[0] + MIN (0, gap / 2); - new.right.width = (int) struts[1] + MIN (0, gap / 2); + c_new.left.width = (int) struts[0] + MIN (0, gap / 2); + c_new.right.width = (int) struts[1] + MIN (0, gap / 2); gap = w->screen->height - struts[2] - struts[3]; gap -= MIN_EMPTY; - new.top.height = (int) struts[2] + MIN (0, gap / 2); - new.bottom.height = (int) struts[3] + MIN (0, gap / 2); + c_new.top.height = (int) struts[2] + MIN (0, gap / 2); + c_new.bottom.height = (int) struts[3] + MIN (0, gap / 2); - new.left.x = 0; - new.right.x = w->screen->width - new.right.width; + c_new.left.x = 0; + c_new.right.x = w->screen->width - c_new.right.width; - new.top.y = 0; - new.bottom.y = w->screen->height - new.bottom.height; + c_new.top.y = 0; + c_new.bottom.y = w->screen->height - c_new.bottom.height; } XFree (data); @@ -1821,57 +1821,57 @@ updateWindowStruts (CompWindow *w) x2 = x1 + w->screen->display->screenInfo[i].width; y2 = y1 + w->screen->display->screenInfo[i].height; - strutX1 = new.left.x; - strutX2 = strutX1 + new.left.width; + strutX1 = c_new.left.x; + strutX2 = strutX1 + c_new.left.width; if (strutX2 > x1 && strutX2 <= x2) { - new.left.x = x1; - new.left.width = strutX2 - x1; + c_new.left.x = x1; + c_new.left.width = strutX2 - x1; } - strutX1 = new.right.x; - strutX2 = strutX1 + new.right.width; + strutX1 = c_new.right.x; + strutX2 = strutX1 + c_new.right.width; if (strutX1 > x1 && strutX1 <= x2) { - new.right.x = strutX1; - new.right.width = x2 - strutX1; + c_new.right.x = strutX1; + c_new.right.width = x2 - strutX1; } - strutY1 = new.top.y; - strutY2 = strutY1 + new.top.height; + strutY1 = c_new.top.y; + strutY2 = strutY1 + c_new.top.height; if (strutY2 > y1 && strutY2 <= y2) { - new.top.y = y1; - new.top.height = strutY2 - y1; + c_new.top.y = y1; + c_new.top.height = strutY2 - y1; } - strutY1 = new.bottom.y; - strutY2 = strutY1 + new.bottom.height; + strutY1 = c_new.bottom.y; + strutY2 = strutY1 + c_new.bottom.height; if (strutY1 > y1 && strutY1 <= y2) { - new.bottom.y = strutY1; - new.bottom.height = y2 - strutY1; + c_new.bottom.y = strutY1; + c_new.bottom.height = y2 - strutY1; } } } if (hasOld != hasNew || (hasNew && hasOld && - memcmp (&new, &old, sizeof (CompStruts)))) + memcmp (&c_new, &old, sizeof (CompStruts)))) { if (hasNew) { if (!w->struts) { - w->struts = malloc (sizeof (CompStruts)); + w->struts = (CompStruts *) malloc (sizeof (CompStruts)); if (!w->struts) return FALSE; } - *w->struts = new; + *w->struts = c_new; } else { @@ -1896,7 +1896,7 @@ setDefaultWindowAttributes (XWindowAttributes *wa) wa->depth = 0; wa->visual = NULL; wa->root = None; - wa->class = InputOnly; + wa->c_class = InputOnly; wa->bit_gravity = NorthWestGravity; wa->win_gravity = NorthWestGravity; wa->backing_store = NotUseful; @@ -2039,7 +2039,7 @@ addWindow (CompScreen *screen, if (screen->windowPrivateLen) { - privates = malloc (screen->windowPrivateLen * sizeof (CompPrivate)); + privates = (CompPrivate *) malloc (screen->windowPrivateLen * sizeof (CompPrivate)); if (!privates) { destroyTexture (screen, w->texture); @@ -2126,7 +2126,7 @@ addWindow (CompScreen *screen, EMPTY_REGION (w->region); - if (w->attrib.class != InputOnly) + if (w->attrib.c_class != InputOnly) { REGION rect; @@ -2432,7 +2432,7 @@ mapWindow (CompWindow *w) if (w->struts) updateWorkareaForScreen (w->screen); - if (w->attrib.class == InputOnly) + if (w->attrib.c_class == InputOnly) return; w->unmapRefCnt = 1; @@ -2717,7 +2717,7 @@ initializeSyncCounter (CompWindow *w) static Bool syncWaitTimeout (void *closure) { - CompWindow *w = closure; + CompWindow *w = (CompWindow *) closure; w->syncWaitHandle = 0; handleSyncAlarm (w); @@ -4282,7 +4282,7 @@ static void revealAncestors (CompWindow *w, void *closure) { - CompWindow *transient = closure; + CompWindow *transient = (CompWindow *) closure; if (isAncestorTo (transient, w)) { @@ -4615,7 +4615,7 @@ static void minimizeTransients (CompWindow *w, void *closure) { - CompWindow *ancestor = closure; + CompWindow *ancestor = (CompWindow *) closure; if (w->transientFor == ancestor->id || isGroupTransient (w, ancestor->clientLeader)) @@ -4644,7 +4644,7 @@ static void unminimizeTransients (CompWindow *w, void *closure) { - CompWindow *ancestor = closure; + CompWindow *ancestor = (CompWindow *) closure; if (w->transientFor == ancestor->id || isGroupTransient (w, ancestor->clientLeader)) @@ -4975,12 +4975,12 @@ getWindowIcon (CompWindow *w, if (iw && ih) { - icon = malloc (sizeof (CompIcon) + + icon = (CompIcon *) malloc (sizeof (CompIcon) + iw * ih * sizeof (CARD32)); if (!icon) continue; - pIcon = realloc (w->icon, + pIcon = (CompIcon **) realloc (w->icon, sizeof (CompIcon *) * (w->nIcon + 1)); if (!pIcon) { |