diff options
author | marha <marha@users.sourceforge.net> | 2014-01-15 21:37:10 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-01-15 21:37:10 +0100 |
commit | b7f01cb1f6cfd1ec301f650a073436c91ec614aa (patch) | |
tree | 1dbf32344313ad7e5884e6686251cad398a231fa | |
parent | 7b4b94b4449aec056c4c92f5cacc2f89a292a80e (diff) | |
parent | 1b0fcca503ae9cf2d462b60770f96c794dfbb27a (diff) | |
download | vcxsrv-b7f01cb1f6cfd1ec301f650a073436c91ec614aa.tar.gz vcxsrv-b7f01cb1f6cfd1ec301f650a073436c91ec614aa.tar.bz2 vcxsrv-b7f01cb1f6cfd1ec301f650a073436c91ec614aa.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
mesa xkeyboard-config xserver git update 15 jan 2014
randrproto libfontenc mesa xserver git update 10 Jan 2014
randsrproto fontconfig libX11 git update 6 Jan 2014
Conflicts:
mesalib/src/glsl/builtin_functions.cpp
mesalib/src/glsl/ir_builder.h
xorg-server/Xext/xres.c
xorg-server/dix/dispatch.c
xorg-server/dix/dixfonts.c
xorg-server/hw/xwin/wingc.c
xorg-server/hw/xwin/winwindowswm.c
xorg-server/include/gc.h
xorg-server/os/access.c
591 files changed, 7360 insertions, 4449 deletions
diff --git a/X11/extensions/randrproto.txt b/X11/extensions/randrproto.txt index f82407c30..2123e7eda 100644 --- a/X11/extensions/randrproto.txt +++ b/X11/extensions/randrproto.txt @@ -108,7 +108,7 @@ instead it provides a mechanism to find out what combinations are supported. 1.3 Introduction to version 1.3 of the extension Version 1.3 builds on the changes made with version 1.2 and adds some new -capabilities without fundmentally changing the extension again. The +capabilities without fundamentally changing the extension again. The following features are added in this version: • Projective Transforms. The implementation work for general rotation @@ -2001,6 +2001,11 @@ Property Immutable Mandatory since ──────── ───────── ─────────────── Border yes not mandatory BorderDimensions yes: static not mandatory + +9.6 Properties introduced with version 1.4.1 of the RandR extension + +Property Immutable Mandatory since +──────── ───────── ─────────────── GUID yes not mandatory ❧❧❧❧❧❧❧❧❧❧❧ diff --git a/fontconfig/fc-cache/fc-cache.c b/fontconfig/fc-cache/fc-cache.c index bf3b6b482..99e0e9f42 100644 --- a/fontconfig/fc-cache/fc-cache.c +++ b/fontconfig/fc-cache/fc-cache.c @@ -187,8 +187,13 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, if (!cache) { - (*changed)++; - cache = FcDirCacheRead (dir, FcTrue, config); + if (!recursive) + cache = FcDirCacheRescan (dir, config); + else + { + (*changed)++; + cache = FcDirCacheRead (dir, FcTrue, config); + } if (!cache) { fprintf (stderr, "%s: error scanning\n", dir); @@ -386,6 +391,7 @@ main (int argc, char **argv) ret += scanDirs (list, config, FcTrue, really_force, verbose, FcFalse, &changed, NULL); FcStrListDone (list); } + FcStrSetDestroy (updateDirs); /* * Try to create CACHEDIR.TAG anyway. diff --git a/fontconfig/fontconfig/fontconfig.h b/fontconfig/fontconfig/fontconfig.h index dfc48f9e3..1a283a1ce 100644 --- a/fontconfig/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig/fontconfig.h @@ -541,6 +541,9 @@ FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir); FcPublic FcCache * FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file); + +FcPublic FcCache * +FcDirCacheRescan (const FcChar8 *dir, FcConfig *config); FcPublic FcCache * FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config); diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c index 10eacffdf..5173e0be2 100644 --- a/fontconfig/src/fccache.c +++ b/fontconfig/src/fccache.c @@ -828,6 +828,19 @@ bail1: return NULL; } +FcCache * +FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs) +{ + FcCache *new; + FcFontSet *set = FcFontSetDeserialize (FcCacheSet (cache)); + const FcChar8 *dir = FcCacheDir (cache); + + new = FcDirCacheBuild (set, dir, dir_stat, dirs); + FcFontSetDestroy (set); + + return new; +} + /* write serialized state to the cache file */ FcBool FcDirCacheWrite (FcCache *cache, FcConfig *config) diff --git a/fontconfig/src/fcdir.c b/fontconfig/src/fcdir.c index b040a285a..3bcd0b867 100644 --- a/fontconfig/src/fcdir.c +++ b/fontconfig/src/fcdir.c @@ -130,7 +130,12 @@ FcFileScanConfig (FcFontSet *set, if (FcFileIsDir (file)) return FcStrSetAdd (dirs, file); else - return FcFileScanFontConfig (set, blanks, file, config); + { + if (set) + return FcFileScanFontConfig (set, blanks, file, config); + else + return FcTrue; + } } FcBool @@ -306,6 +311,45 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config) return cache; } +FcCache * +FcDirCacheRescan (const FcChar8 *dir, FcConfig *config) +{ + FcCache *cache = FcDirCacheLoad (dir, config, NULL); + FcCache *new = NULL; + struct stat dir_stat; + FcStrSet *dirs; + + if (!cache) + return NULL; + if (FcStatChecksum (dir, &dir_stat) < 0) + goto bail; + dirs = FcStrSetCreate (); + if (!dirs) + goto bail; + + /* + * Scan the dir + */ + if (!FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, config)) + goto bail1; + /* + * Rebuild the cache object + */ + new = FcDirCacheRebuild (cache, &dir_stat, dirs); + if (!new) + goto bail1; + FcDirCacheUnload (cache); + /* + * Write out the cache file, ignoring any troubles + */ + FcDirCacheWrite (new, config); + +bail1: + FcStrSetDestroy (dirs); +bail: + return new; +} + /* * Read (or construct) the cache for a directory */ diff --git a/fontconfig/src/fcfs.c b/fontconfig/src/fcfs.c index 941abba8f..21c6c7cbb 100644 --- a/fontconfig/src/fcfs.c +++ b/fontconfig/src/fcfs.c @@ -122,6 +122,28 @@ FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s) return s_serialize; } + +FcFontSet * +FcFontSetDeserialize (const FcFontSet *set) +{ + int i; + FcFontSet *new = FcFontSetCreate (); + + if (!new) + return NULL; + for (i = 0; i < set->nfont; i++) + { + if (!FcFontSetAdd (new, FcPatternDuplicate (FcFontSetFont (set, i)))) + goto bail; + } + + return new; +bail: + FcFontSetDestroy (new); + + return NULL; +} + #define __fcfs__ #include "fcaliastail.h" #undef __fcfs__ diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h index 362ea6f99..cdf2daba0 100644 --- a/fontconfig/src/fcint.h +++ b/fontconfig/src/fcint.h @@ -567,6 +567,9 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config); FcPrivate FcCache * FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs); +FcPrivate FcCache * +FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs); + FcPrivate FcBool FcDirCacheWrite (FcCache *cache, FcConfig *config); @@ -838,6 +841,9 @@ FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s); FcPrivate FcFontSet * FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s); +FcPrivate FcFontSet * +FcFontSetDeserialize (const FcFontSet *set); + /* fchash.c */ FcPrivate FcChar8 * FcHashGetSHA256Digest (const FcChar8 *input_strings, diff --git a/fontconfig/src/fcpat.c b/fontconfig/src/fcpat.c index 0614ac2c2..986cca391 100644 --- a/fontconfig/src/fcpat.c +++ b/fontconfig/src/fcpat.c @@ -33,6 +33,7 @@ FcPatternCreate (void) p = (FcPattern *) malloc (sizeof (FcPattern)); if (!p) return 0; + memset (p, 0, sizeof (FcPattern)); p->num = 0; p->size = 0; p->elts_offset = FcPtrToOffset (p, NULL); @@ -1310,6 +1311,7 @@ FcValueListSerialize (FcSerialize *serialize, const FcValueList *vl) } return head_serialized; } + #define __fcpat__ #include "fcaliastail.h" #include "fcftaliastail.h" diff --git a/libX11/src/XlibInt.c b/libX11/src/XlibInt.c index 5d8b0eb4b..15f94aa0a 100644 --- a/libX11/src/XlibInt.c +++ b/libX11/src/XlibInt.c @@ -76,27 +76,6 @@ xthread_t (*_Xthread_self_fn)(void) = NULL; #endif /* XTHREADS */ -/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX - * systems are broken and return EWOULDBLOCK when they should return EAGAIN - */ -#ifdef WIN32 -#define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK) -#else -#ifdef __CYGWIN__ /* Cygwin uses ENOBUFS to signal socket is full */ -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS) -#else -#if defined(EAGAIN) && defined(EWOULDBLOCK) -#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK) -#else -#ifdef EAGAIN -#define ETEST() (errno == EAGAIN) -#else -#define ETEST() (errno == EWOULDBLOCK) -#endif /* EAGAIN */ -#endif /* EAGAIN && EWOULDBLOCK */ -#endif /* __CYGWIN__ */ -#endif /* WIN32 */ - #ifdef WIN32 #define ECHECK(err) (WSAGetLastError() == err) #define ESET(val) WSASetLastError(val) @@ -110,18 +89,6 @@ xthread_t (*_Xthread_self_fn)(void) = NULL; #endif #endif -#if defined(LOCALCONN) || defined(LACHMAN) -#ifdef EMSGSIZE -#define ESZTEST() (ECHECK(EMSGSIZE) || ECHECK(ERANGE)) -#else -#define ESZTEST() ECHECK(ERANGE) -#endif -#else -#ifdef EMSGSIZE -#define ESZTEST() ECHECK(EMSGSIZE) -#endif -#endif - #ifdef __UNIXOS2__ #include <limits.h> #define MAX_PATH _POSIX_PATH_MAX diff --git a/libX11/src/xkb/XKB.c b/libX11/src/xkb/XKB.c index 7a66b3668..dbcfff05d 100644 --- a/libX11/src/xkb/XKB.c +++ b/libX11/src/xkb/XKB.c @@ -174,9 +174,6 @@ XkbSelectEventDetails(Display *dpy, /* doesn't. Make sure that we always request the stuff */ /* that the implicit support needs, and just filter out anything */ /* the client doesn't want later */ - req->affectWhich = 0; - req->selectAll = 0; - req->clear = 0; req->affectMap = (CARD16) affect; req->map = (CARD16) details | (XkbAllClientInfoMask & affect); req->affectWhich = XkbMapNotifyMask; diff --git a/libX11/src/xkb/XKBGeom.c b/libX11/src/xkb/XKBGeom.c index c3fd27f15..c42a453e4 100644 --- a/libX11/src/xkb/XKBGeom.c +++ b/libX11/src/xkb/XKBGeom.c @@ -472,9 +472,9 @@ _XkbReadGeomOverlay(XkbReadBufferPtr buf, if (rowWire == NULL) return BadLength; row = XkbAddGeomOverlayRow(ol, rowWire->rowUnder, rowWire->nKeys); - row->row_under = rowWire->rowUnder; if (!row) return BadAlloc; + row->row_under = rowWire->rowUnder; if (rowWire->nKeys < 1) continue; keyWire = (xkbOverlayKeyWireDesc *) diff --git a/libfontenc/src/encparse.c b/libfontenc/src/encparse.c index bf7de5fc4..d2f460f35 100644 --- a/libfontenc/src/encparse.c +++ b/libfontenc/src/encparse.c @@ -301,7 +301,7 @@ getnextline(FontFilePtr f) } } else if(!strcasecmp(keyword_value, "STARTMAPPING")) { keyword_value[0] = 0; - value1 = 0; value1 = 0; + value1 = 0; value2 = 0; /* first a keyword */ token = gettoken(f,c,&c); if(token != KEYWORD_TOKEN) { diff --git a/mesalib/common.py b/mesalib/common.py index 1d618e675..22c172571 100644 --- a/mesalib/common.py +++ b/mesalib/common.py @@ -100,4 +100,4 @@ def AddOptions(opts): opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes')) opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no')) if host_platform == 'windows': - opts.Add(EnumOption('MSVC_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0', '10.0', '11.0'))) + opts.Add(EnumOption('MSVC_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0', '10.0', '11.0', '12.0'))) diff --git a/mesalib/configure.ac b/mesalib/configure.ac index f75325d33..4da6c51d3 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -32,7 +32,7 @@ LIBDRM_RADEON_REQUIRED=2.4.50 LIBDRM_INTEL_REQUIRED=2.4.49 LIBDRM_NVVIEUX_REQUIRED=2.4.33 LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41" -LIBDRM_FREEDRENO_REQUIRED=2.4.39 +LIBDRM_FREEDRENO_REQUIRED=2.4.51 DRI2PROTO_REQUIRED=2.6 DRI3PROTO_REQUIRED=1.0 PRESENTPROTO_REQUIRED=1.0 @@ -583,7 +583,7 @@ AC_ARG_ENABLE([xvmc], [AS_HELP_STRING([--enable-xvmc], [enable xvmc library @<:@default=auto@:>@])], [enable_xvmc="$enableval"], - [enable_xvmc=auto]) + [enable_xvmc=no]) AC_ARG_ENABLE([vdpau], [AS_HELP_STRING([--enable-vdpau], [enable vdpau library @<:@default=auto@:>@])], @@ -1567,9 +1567,9 @@ if test "x$enable_gallium_llvm" = xauto; then fi if test "x$enable_gallium_llvm" = xyes; then if test "x$llvm_prefix" != x; then - AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"]) + AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"]) else - AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no]) + AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no]) fi if test "x$LLVM_CONFIG" != xno; then diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt index f98a54a78..0672ec708 100644 --- a/mesalib/docs/GL3.txt +++ b/mesalib/docs/GL3.txt @@ -132,7 +132,7 @@ GL 4.2: GL_ARB_texture_storage DONE (all drivers) GL_ARB_transform_feedback_instanced DONE (i965, r600, radeonsi) GL_ARB_base_instance DONE (i965, nv50, nvc0, r600, radeonsi) - GL_ARB_shader_image_load_store not started + GL_ARB_shader_image_load_store in progress (curro) GL_ARB_conservative_depth DONE (all drivers that support GLSL 1.30) GL_ARB_shading_language_420pack DONE (all drivers that support GLSL 1.30) GL_ARB_internalformat_query DONE (i965, r300, r600, radeonsi) diff --git a/mesalib/docs/conform.html b/mesalib/docs/conform.html index c5f8ece83..55931376b 100644 --- a/mesalib/docs/conform.html +++ b/mesalib/docs/conform.html @@ -19,7 +19,7 @@ <p> The SGI OpenGL conformance tests verify correct operation of OpenGL implementations. I, Brian Paul, have been given a copy of the tests -for testing Mesa. The tests are not publically available. +for testing Mesa. The tests are not publicly available. </p> <p> This file has the latest results of testing Mesa with the OpenGL 1.2 diff --git a/mesalib/docs/devinfo.html b/mesalib/docs/devinfo.html index a9d8b4f7d..d4a6dfb59 100644 --- a/mesalib/docs/devinfo.html +++ b/mesalib/docs/devinfo.html @@ -206,7 +206,7 @@ exclusively for the older branch. This "CC" syntax for patch nomination will cause patches to automatically be copied to the mesa-stable@ mailing list when you use "git send-email" to send patches to the mesa-dev@ mailing list. Also, if you realize that a commit -should be nominate for the stable branch after it has already been commited, +should be nominated for the stable branch after it has already been committed, you can send a note directly to the mesa-stable@lists.freedesktop.org where the Mesa stable-branch maintainers will receive it. Be sure to mention the commit ID of the commit of interest (as it appears in the mesa master branch). diff --git a/mesalib/docs/dispatch.html b/mesalib/docs/dispatch.html index 4b529bc04..aacd01e0c 100644 --- a/mesalib/docs/dispatch.html +++ b/mesalib/docs/dispatch.html @@ -25,7 +25,7 @@ href="#overview">overview of Mesa's implementation</a>.</p> <h2>1. Complexity of GL Dispatch</h2> <p>Every GL application has at least one object called a GL <em>context</em>. -This object, which is an implicit parameter to ever GL function, stores all +This object, which is an implicit parameter to every GL function, stores all of the GL related state for the application. Every texture, every buffer object, every enable, and much, much more is stored in the context. Since an application can have more than one context, the context to be used is @@ -51,7 +51,7 @@ example, <tt>glFogCoordf</tt> may operate differently depending on whether or not fog is enabled.</p> <p>In multi-threaded environments, it is possible for each thread to have a -differnt GL context current. This means that poor old <tt>glVertex3fv</tt> +different GL context current. This means that poor old <tt>glVertex3fv</tt> has to know which GL context is current in the thread where it is being called.</p> @@ -207,13 +207,13 @@ few preprocessor defines.</p> <li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li> <li>If <tt>HAVE_PTHREAD</tt> is defined, method #3 is used.</li> <li>If <tt>WIN32_THREADS</tt> is defined, method #2 is used.</li> -<li>If none of the preceeding are defined, method #1 is used.</li> +<li>If none of the preceding are defined, method #1 is used.</li> </ul> <p>Two different techniques are used to handle the various different cases. On x86 and SPARC, a macro called <tt>GL_STUB</tt> is used. In the preamble of the assembly source file different implementations of the macro are -selected based on the defined preprocessor variables. The assmebly code +selected based on the defined preprocessor variables. The assembly code then consists of a series of invocations of the macros such as: <blockquote> @@ -242,7 +242,7 @@ first technique, is to insert <tt>#ifdef</tt> within the assembly implementation of each function. This makes the assembly file considerably larger (e.g., 29,332 lines for <tt>glapi_x86-64.S</tt> versus 1,155 lines for <tt>glapi_x86.S</tt>) and causes simple changes to the function -implementation to generate many lines of diffs. Since the assmebly files +implementation to generate many lines of diffs. Since the assembly files are typically generated by scripts (see <a href="#autogen">below</a>), this isn't a significant problem.</p> diff --git a/mesalib/docs/egl.html b/mesalib/docs/egl.html index 240cec53a..dc2324194 100644 --- a/mesalib/docs/egl.html +++ b/mesalib/docs/egl.html @@ -88,7 +88,7 @@ drivers will be installed to <code>${libdir}/egl</code>.</p> <dd> <p>List the platforms (window systems) to support. Its argument is a comma -seprated string such as <code>--with-egl-platforms=x11,drm</code>. It decides +separated string such as <code>--with-egl-platforms=x11,drm</code>. It decides the platforms a driver may support. The first listed platform is also used by the main library to decide the native platform: the platform the EGL native types such as <code>EGLNativeDisplayType</code> or @@ -223,7 +223,7 @@ the X server directly using (XCB-)DRI2 protocol.</p> <dd> <p>This driver is based on Gallium3D. It supports all rendering APIs and -hardwares supported by Gallium3D. It is the only driver that supports OpenVG. +hardware supported by Gallium3D. It is the only driver that supports OpenVG. The supported platforms are X11, DRM, FBDEV, and GDI.</p> <p>This driver comes with its own hardware drivers @@ -273,8 +273,8 @@ longer than the display that creates them.</p> <p>In EGL, when a display is terminated through <code>eglTerminate</code>, all display resources should be destroyed. Similarly, when a thread is released -throught <code>eglReleaseThread</code>, all current display resources should be -released. Another way to destory or release resources is through functions +through <code>eglReleaseThread</code>, all current display resources should be +released. Another way to destroy or release resources is through functions such as <code>eglDestroySurface</code> or <code>eglMakeCurrent</code>.</p> <p>When a resource that is current to some thread is destroyed, the resource diff --git a/mesalib/docs/envvars.html b/mesalib/docs/envvars.html index 3cc3c8096..31d14a45a 100644 --- a/mesalib/docs/envvars.html +++ b/mesalib/docs/envvars.html @@ -47,7 +47,7 @@ sometimes be useful for debugging end-user issues. <li>MESA_NO_SSE - if set, disables Intel SSE optimizations <li>MESA_DEBUG - if set, error messages are printed to stderr. For example, if the application generates a GL_INVALID_ENUM error, a corresponding error - message indicating where the error occured, and possibly why, will be + message indicating where the error occurred, and possibly why, will be printed to stderr.<br> If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will generate exceptions. @@ -201,14 +201,14 @@ See src/mesa/state_tracker/st_debug.c for other options. to stderr <li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes. <li>SOFTPIPE_USE_LLVM - if set, the softpipe driver will try to use LLVM JIT for - vertex shading procesing. + vertex shading processing. </ul> <h3>LLVMpipe driver environment variables</h3> <ul> <li>LP_NO_RAST - if set LLVMpipe will no-op rasterization -<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the +<li>LP_DEBUG - a comma-separated list of debug options is accepted. See the source code for details. <li>LP_PERF - a comma-separated list of options to selectively no-op various parts of the driver. See the source code for details. diff --git a/mesalib/docs/faq.html b/mesalib/docs/faq.html index 97c59d381..d4037e83c 100644 --- a/mesalib/docs/faq.html +++ b/mesalib/docs/faq.html @@ -137,7 +137,7 @@ Just follow the Mesa <a href="install.html">compilation instructions</a>. <h2>1.6 Are there other open-source implementations of OpenGL?</h2> <p> Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html"> -OpenGL Sample Implemenation (SI)</a> is available. +OpenGL Sample Implementation (SI)</a> is available. The SI was written during the time that OpenGL was originally designed. Unfortunately, development of the SI has stagnated. Mesa is much more up to date with modern features and extensions. @@ -353,7 +353,7 @@ That's where Mesa development is discussed. </p> <p> The <a href="http://www.opengl.org/documentation"> -OpenGL Specification</a> is the bible for OpenGL implemention work. +OpenGL Specification</a> is the bible for OpenGL implementation work. You should read it. </p> <p>Most of the Mesa development work involves implementing new OpenGL @@ -375,7 +375,7 @@ For a Gallium3D hardware driver, the r300g, r600g and the i915g are good example </p> <p>The DRI website has more information about writing hardware drivers. The process isn't well document because the Mesa driver interface changes -over time, and we seldome have spare time for writing documentation. +over time, and we seldom have spare time for writing documentation. That being said, many people have managed to figure out the process. </p> <p> @@ -390,7 +390,7 @@ The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compres indicates that there are intellectual property (IP) and/or patent issues to be dealt with. </p> -<p>We've been unsucessful in getting a response from S3 (or whoever owns +<p>We've been unsuccessful in getting a response from S3 (or whoever owns the IP nowadays) to indicate whether or not an open source project can implement the extension (specifically the compression/decompression algorithms). diff --git a/mesalib/docs/index.html b/mesalib/docs/index.html index e26e9e5b7..1d3772899 100644 --- a/mesalib/docs/index.html +++ b/mesalib/docs/index.html @@ -16,11 +16,17 @@ <h1>News</h1> +<h2>January 9, 2014</h2> +<p> +<a href="relnotes/10.0.2.html">Mesa 10.0.2</a> is released. +This is a bug-fix release. +</p> + <h2>December 12, 2013</h2> <p> <a href="relnotes/10.0.1.html">Mesa 10.0.1</a> and <a href="relnotes/9.2.5.html">Mesa 9.2.5</a> are released. -These are both bug-fix releases +These are both bug-fix releases. </p> <h2>November 30, 2013</h2> diff --git a/mesalib/docs/opengles.html b/mesalib/docs/opengles.html index f08acb57b..24ad69fe2 100644 --- a/mesalib/docs/opengles.html +++ b/mesalib/docs/opengles.html @@ -16,7 +16,7 @@ <h1>OpenGL ES</h1> -<p>Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More informations about +<p>Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More information about OpenGL ES can be found at <a href="http://www.khronos.org/opengles/"> http://www.khronos.org/opengles/</a>.</p> @@ -48,7 +48,7 @@ EGL drivers for your hardware.</p> <h3>Dispatch Table</h3> -<p>OpenGL ES has an additional indirection when dispatching fucntions</p> +<p>OpenGL ES has an additional indirection when dispatching functions</p> <pre> Mesa: glFoo() --> _mesa_Foo() diff --git a/mesalib/docs/openvg.html b/mesalib/docs/openvg.html index 5bc866a33..28ebb82e8 100644 --- a/mesalib/docs/openvg.html +++ b/mesalib/docs/openvg.html @@ -20,7 +20,7 @@ The current version of the OpenVG state tracker implements OpenVG 1.1. </p> <p> -More informations about OpenVG can be found at +More information about OpenVG can be found at <a href="http://www.khronos.org/openvg/"> http://www.khronos.org/openvg/</a> . </p> diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html index 70e5862fa..c3c277dea 100644 --- a/mesalib/docs/relnotes.html +++ b/mesalib/docs/relnotes.html @@ -22,6 +22,7 @@ The release notes summarize what's new or changed in each Mesa release. <ul> <li><a href="relnotes/10.1.html">10.1 release notes</a> +<li><a href="relnotes/10.0.2.html">10.0.2 release notes</a> <li><a href="relnotes/10.0.1.html">10.0.1 release notes</a> <li><a href="relnotes/10.0.html">10.0 release notes</a> <li><a href="relnotes/9.2.5.html">9.2.5 release notes</a> diff --git a/mesalib/docs/relnotes/10.0.2.html b/mesalib/docs/relnotes/10.0.2.html new file mode 100644 index 000000000..f3824dfea --- /dev/null +++ b/mesalib/docs/relnotes/10.0.2.html @@ -0,0 +1,161 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <title>Mesa Release Notes</title> + <link rel="stylesheet" type="text/css" href="../mesa.css"> +</head> +<body> + +<div class="header"> + <h1>The Mesa 3D Graphics Library</h1> +</div> + +<iframe src="../contents.html"></iframe> +<div class="content"> + +<h1>Mesa 10.0.2 Release Notes / (January 9, 2014)</h1> + +<p> +Mesa 10.0.2 is a bug fix release which fixes bugs found since the 10.0.1 release. +</p> +<p> +Mesa 10.0.2 implements the OpenGL 3.3 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 3.3. OpenGL +3.3 is <strong>only</strong> available if requested at context creation +because compatibility contexts not supported. +</p> + + +<h2>MD5 checksums</h2> +<pre> +de7d14baf0101b697c140d2f47ef27e9 MesaLib-10.0.2.tar.gz +8544c0ab3e438a08b5103421ea15b6d2 MesaLib-10.0.2.tar.bz2 +181b0d6c1afca38e98a930d0e564ed90 MesaLib-10.0.2.zip +</pre> + + +<h2>New features</h2> +<p>None</p> + +<h2>Bug fixes</h2> + +<p>This list is likely incomplete.</p> + +<ul> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70740">Bug 70740</a> - HiZ on SNB causes GPU hang with WebGL web app</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72026">Bug 72026</a> - SIGSEGV in fs_visitor::visit(ir_dereference_variable*)</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72264">Bug 72264</a> - GLSL error reporting</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72369">Bug 72369</a> - glitches in serious sam 3 with the sb shader backend</li> + +</ul> + +<h2>Changes</h2> + +<p>The full set of changes can be viewed by using the following git command:</p> + +<pre> + git log mesa-10.0.1..mesa-10.0.2 +</pre> + +<p>Aaron Watry (8):</p> +<ul> + <li>clover: Remove unused variable</li> + <li>pipe_loader/sw: close dev->lib when initialization fails</li> + <li>radeon/compute: Stop leaking LLVMContexts in radeon_llvm_parse_bitcode</li> + <li>r600/compute: Free compiled kernels when deleting compute state</li> + <li>r600/compute: Use the correct FREE macro when deleting compute state</li> + <li>radeon/llvm: Free target data at end of optimization</li> + <li>st/vdpau: Destroy context when initialization fails</li> + <li>r600/pipe: Stop leaking context->start_compute_cs_cmd.buf on EG/CM</li> +</ul> + +<p>Alex Deucher (1):</p> +<ul> + <li>r600g: fix SUMO2 pci id</li> +</ul> + +<p>Alexander von Gluck IV (1):</p> +<ul> + <li>Haiku: Add in public GL kit headers</li> +</ul> + +<p>Anuj Phogat (1):</p> +<ul> + <li>mesa: Fix error code generation in glBeginConditionalRender()</li> +</ul> + +<p>Carl Worth (2):</p> +<ul> + <li>docs: Add md5sums for the 10.0.1 release.</li> + <li>Update version to 10.0.2</li> +</ul> + +<p>Chad Versace (1):</p> +<ul> + <li>i965/gen6: Fix HiZ hang in WebGL Google Maps</li> +</ul> + +<p>Erik Faye-Lund (1):</p> +<ul> + <li>glcpp: error on multiple #else/#elif directives</li> +</ul> + +<p>Henri Verbeet (1):</p> +<ul> + <li>i915: Add support for gl_FragData[0] reads.</li> +</ul> + +<p>Ilia Mirkin (1):</p> +<ul> + <li>nv50: fix a small leak on context destroy</li> +</ul> + +<p>Jonathan Liu (2):</p> +<ul> + <li>st/mesa: use pipe_sampler_view_release()</li> + <li>llvmpipe: use pipe_sampler_view_release() to avoid segfault</li> +</ul> + +<p>Kenneth Graunke (2):</p> +<ul> + <li>i965: Fix 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet creation.</li> + <li>Revert "mesa: Remove GLXContextID typedef from glx.h."</li> +</ul> + +<p>Kevin Rogovin (1):</p> +<ul> + <li>Use line number information from entire function expression</li> +</ul> + +<p>Kristian Høgsberg (1):</p> +<ul> + <li>dri_util: Don't assume __DRIcontext->driverPrivate is a gl_context</li> +</ul> + +<p>Marek Olšák (2):</p> +<ul> + <li>mesa: fix interpretation of glClearBuffer(drawbuffer)</li> + <li>st/mesa: fix glClear with multiple colorbuffers and different formats</li> +</ul> + +<p>Paul Berry (2):</p> +<ul> + <li>glsl: Teach ir_variable_refcount about ir_loop::counter variables.</li> + <li>glsl: Fix inconsistent assumptions about ir_loop::counter.</li> +</ul> + +<p>Vadim Girlin (1):</p> +<ul> + <li>r600g/sb: fix stack size computation on evergreen</li> +</ul> + +</div> +</body> +</html> diff --git a/mesalib/docs/relnotes/10.1.html b/mesalib/docs/relnotes/10.1.html index 778ae6a57..1089c7199 100644 --- a/mesalib/docs/relnotes/10.1.html +++ b/mesalib/docs/relnotes/10.1.html @@ -46,6 +46,7 @@ Note: some of the new features are only available with certain drivers. <ul> <li>GL_ARB_draw_indirect on i965.</li> <li>GL_ARB_clear_buffer_object</li> +<li>GL_AMD_shader_trinary_minmax.</li> </ul> diff --git a/mesalib/docs/repository.html b/mesalib/docs/repository.html index 510f4381a..bb0ae008e 100644 --- a/mesalib/docs/repository.html +++ b/mesalib/docs/repository.html @@ -156,7 +156,7 @@ each time you do a pull. </p> <li>Small changes to master <p> -If you are an experienced git user working on substancial modifications, +If you are an experienced git user working on substantial modifications, you are probably working on a separate branch and would rebase your branch prior to merging with master. diff --git a/mesalib/docs/shading.html b/mesalib/docs/shading.html index 4015cdf2e..77a0ee413 100644 --- a/mesalib/docs/shading.html +++ b/mesalib/docs/shading.html @@ -234,7 +234,7 @@ This option is only relevant if EmitHighLevelInstructions is set. <dt>EmitComments</dt> <dd> -If set, instructions will be annoted with comments to help with debugging. +If set, instructions will be annotated with comments to help with debugging. Extra NOP instructions will also be inserted. </dd> </dl> diff --git a/mesalib/docs/sourcetree.html b/mesalib/docs/sourcetree.html index a6868d398..4c93f6341 100644 --- a/mesalib/docs/sourcetree.html +++ b/mesalib/docs/sourcetree.html @@ -123,7 +123,7 @@ each directory. Currently there's run-time code generation for x86/SSE, PowerPC and Cell SPU. <li><b>tgsi</b> - TG Shader Infrastructure. Code for encoding, - manipulating and interpretting GPU programs. + manipulating and interpreting GPU programs. <li><b>translate</b> - module for translating vertex data from one format to another. <li><b>util</b> - assorted utilities for arithmetic, hashing, surface diff --git a/mesalib/docs/thanks.html b/mesalib/docs/thanks.html index 4ec92d3c2..29a41e49c 100644 --- a/mesalib/docs/thanks.html +++ b/mesalib/docs/thanks.html @@ -14,7 +14,7 @@ <iframe src="contents.html"></iframe> <div class="content"> -<h1>Acknowledgments</h1> +<h1>Acknowledgements</h1> The following individuals and groups are to be acknowledged for their diff --git a/mesalib/docs/vmware-guest.html b/mesalib/docs/vmware-guest.html index 833f06ceb..b5ea4e0be 100644 --- a/mesalib/docs/vmware-guest.html +++ b/mesalib/docs/vmware-guest.html @@ -27,9 +27,10 @@ MacOS are all supported. </p> <p> -End users shouldn't have to go through all these steps once the driver is -included in newer Linux distributions. -Fedora 18 and Ubuntu 12.10 include the VMware guest GL driver, for example. +Most modern Linux distros include the SVGA3D driver so end users shouldn't +be concerned with this information. +But if your distro lacks the driver or you want to update to the latest code +these instructions explain what to do. </p> <p> @@ -53,6 +54,13 @@ The components involved in this include: <li>Mesa/gallium OpenGL driver: "svga" </ul> +<p> +All of these components reside in the guest Linux virtual machine. +On the host, all you're doing is running VMware +<a href="http://www.vmware.com/products/workstation/">Workstation</a> or +<a href="http://www.vmware.com/products/fusion/">Fusion</a>. +</p> + <h2>Prerequisites</h2> diff --git a/mesalib/docs/xlibdriver.html b/mesalib/docs/xlibdriver.html index ce1ff3b13..d3d8ab4db 100644 --- a/mesalib/docs/xlibdriver.html +++ b/mesalib/docs/xlibdriver.html @@ -107,7 +107,7 @@ for your application. <p> When using Mesa directly or with GLX, it's up to the application writer to create a window with an appropriate colormap. The GLUT -toolkit tris to minimize colormap <em>flashing</em> by sharing +toolkit tries to minimize colormap <em>flashing</em> by sharing colormaps when possible. Specifically, if the visual and depth of the window matches that of the root window, the root window's colormap will be shared by the Mesa window. Otherwise, a new, private colormap diff --git a/mesalib/include/GL/glxext.h b/mesalib/include/GL/glxext.h index cfabe8cc3..713238519 100644 --- a/mesalib/include/GL/glxext.h +++ b/mesalib/include/GL/glxext.h @@ -272,7 +272,6 @@ __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName); #ifndef GLX_EXT_import_context #define GLX_EXT_import_context 1 -typedef XID GLXContextID; #define GLX_SHARE_CONTEXT_EXT 0x800A #define GLX_VISUAL_ID_EXT 0x800B #define GLX_SCREEN_EXT 0x800C diff --git a/mesalib/src/SConscript b/mesalib/src/SConscript index 146591866..a24aceaea 100644 --- a/mesalib/src/SConscript +++ b/mesalib/src/SConscript @@ -18,6 +18,11 @@ if env['hostonly']: # enable OpenGL ES support. SConscript('mapi/glapi/gen/SConscript') SConscript('mapi/glapi/SConscript') + +# Haiku C++ libGL dispatch (renderers depend on libgl) +if env['platform'] in ['haiku']: + SConscript('hgl/SConscript') + SConscript('mesa/SConscript') SConscript('mapi/vgapi/SConscript') diff --git a/mesalib/src/gallium/SConscript b/mesalib/src/gallium/SConscript index 6e27be2c0..32bbdbe56 100644 --- a/mesalib/src/gallium/SConscript +++ b/mesalib/src/gallium/SConscript @@ -119,7 +119,6 @@ if not env['embedded']: if env['platform'] == 'haiku': SConscript([ 'targets/haiku-softpipe/SConscript', - 'targets/libgl-haiku/SConscript', ]) if env['dri']: diff --git a/mesalib/src/gallium/auxiliary/util/u_clear.h b/mesalib/src/gallium/auxiliary/util/u_clear.h index 75047c16b..bd8efdb4a 100644 --- a/mesalib/src/gallium/auxiliary/util/u_clear.h +++ b/mesalib/src/gallium/auxiliary/util/u_clear.h @@ -47,7 +47,10 @@ util_clear(struct pipe_context *pipe, for (i = 0; i < framebuffer->nr_cbufs; i++) { if (buffers & (PIPE_CLEAR_COLOR0 << i)) { struct pipe_surface *ps = framebuffer->cbufs[i]; - pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width, ps->height); + + if (ps) { + pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width, ps->height); + } } } diff --git a/mesalib/src/gallium/auxiliary/util/u_framebuffer.c b/mesalib/src/gallium/auxiliary/util/u_framebuffer.c index 683967237..2e0ef749e 100644 --- a/mesalib/src/gallium/auxiliary/util/u_framebuffer.c +++ b/mesalib/src/gallium/auxiliary/util/u_framebuffer.c @@ -127,6 +127,9 @@ util_framebuffer_min_size(const struct pipe_framebuffer_state *fb, unsigned i; for (i = 0; i < fb->nr_cbufs; i++) { + if (!fb->cbufs[i]) + continue; + w = MIN2(w, fb->cbufs[i]->width); h = MIN2(h, fb->cbufs[i]->height); } @@ -171,3 +174,24 @@ util_framebuffer_get_num_layers(const struct pipe_framebuffer_state *fb) } return num_layers; } + + +/** + * Return the number of MSAA samples. + */ +unsigned +util_framebuffer_get_num_samples(const struct pipe_framebuffer_state *fb) +{ + unsigned i; + + for (i = 0; i < fb->nr_cbufs; i++) { + if (fb->cbufs[i]) { + return MAX2(1, fb->cbufs[i]->texture->nr_samples); + } + } + if (fb->zsbuf) { + return MAX2(1, fb->zsbuf->texture->nr_samples); + } + + return 1; +} diff --git a/mesalib/src/gallium/auxiliary/util/u_framebuffer.h b/mesalib/src/gallium/auxiliary/util/u_framebuffer.h index 0e6c98363..c73942c9c 100644 --- a/mesalib/src/gallium/auxiliary/util/u_framebuffer.h +++ b/mesalib/src/gallium/auxiliary/util/u_framebuffer.h @@ -60,6 +60,10 @@ extern unsigned util_framebuffer_get_num_layers(const struct pipe_framebuffer_state *fb); +extern unsigned +util_framebuffer_get_num_samples(const struct pipe_framebuffer_state *fb); + + #ifdef __cplusplus } #endif diff --git a/mesalib/src/glsl/ast_function.cpp b/mesalib/src/glsl/ast_function.cpp index e4c0fd1c4..2d05d0723 100644 --- a/mesalib/src/glsl/ast_function.cpp +++ b/mesalib/src/glsl/ast_function.cpp @@ -293,15 +293,10 @@ generate_call(exec_list *instructions, ir_function_signature *sig, * call takes place. Since we haven't emitted the call yet, we'll place * the post-call conversions in a temporary exec_list, and emit them later. */ - exec_list_iterator actual_iter = actual_parameters->iterator(); - exec_list_iterator formal_iter = sig->parameters.iterator(); - - while (actual_iter.has_next()) { - ir_rvalue *actual = (ir_rvalue *) actual_iter.get(); - ir_variable *formal = (ir_variable *) formal_iter.get(); - - assert(actual != NULL); - assert(formal != NULL); + foreach_two_lists(formal_node, &sig->parameters, + actual_node, actual_parameters) { + ir_rvalue *actual = (ir_rvalue *) actual_node; + ir_variable *formal = (ir_variable *) formal_node; if (formal->type->is_numeric() || formal->type->is_boolean()) { switch (formal->data.mode) { @@ -323,9 +318,6 @@ generate_call(exec_list *instructions, ir_function_signature *sig, break; } } - - actual_iter.next(); - formal_iter.next(); } /* If the function call is a constant expression, don't generate any diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index 91810f985..4cc8eb18d 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -1860,7 +1860,7 @@ ast_fully_specified_type::glsl_type(const char **name, if (type->base_type == GLSL_TYPE_FLOAT && state->es_shader - && state->target == MESA_SHADER_FRAGMENT + && state->stage == MESA_SHADER_FRAGMENT && this->qualifier.precision == ast_precision_none && state->symbols->get_variable("#default precision") == NULL) { YYLTYPE loc = this->get_location(); @@ -1882,7 +1882,7 @@ ast_fully_specified_type::glsl_type(const char **name, * this function will produce undefined results. */ static bool -is_varying_var(ir_variable *var, gl_shader_type target) +is_varying_var(ir_variable *var, gl_shader_stage target) { switch (target) { case MESA_SHADER_VERTEX: @@ -1983,18 +1983,7 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state, * with an array of size N, all elements of the array from binding * through binding + N - 1 must be within this range." */ - unsigned limit = 0; - switch (state->target) { - case MESA_SHADER_VERTEX: - limit = ctx->Const.VertexProgram.MaxTextureImageUnits; - break; - case MESA_SHADER_GEOMETRY: - limit = ctx->Const.GeometryProgram.MaxTextureImageUnits; - break; - case MESA_SHADER_FRAGMENT: - limit = ctx->Const.FragmentProgram.MaxTextureImageUnits; - break; - } + unsigned limit = ctx->Const.Program[state->stage].MaxTextureImageUnits; if (max_index >= limit) { _mesa_glsl_error(loc, state, "layout(binding = %d) for %d samplers " @@ -2049,8 +2038,8 @@ interpret_interpolation_qualifier(const struct ast_type_qualifier *qual, } - if ((state->target == MESA_SHADER_VERTEX && mode == ir_var_shader_in) || - (state->target == MESA_SHADER_FRAGMENT && mode == ir_var_shader_out)) { + if ((state->stage == MESA_SHADER_VERTEX && mode == ir_var_shader_in) || + (state->stage == MESA_SHADER_FRAGMENT && mode == ir_var_shader_out)) { _mesa_glsl_error(loc, state, "interpolation qualifier `%s' cannot be applied to " "vertex shader inputs or fragment shader outputs", @@ -2076,7 +2065,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual, * In the fragment shader only shader outputs can be given explicit * locations. */ - switch (state->target) { + switch (state->stage) { case MESA_SHADER_VERTEX: if (var->data.mode == ir_var_shader_in) { if (!state->check_explicit_attrib_location_allowed(loc, var)) @@ -2110,7 +2099,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual, _mesa_glsl_error(loc, state, "%s cannot be given an explicit location in %s shader", mode_string(var), - _mesa_shader_type_to_string(state->target)); + _mesa_shader_stage_to_string(state->stage)); } else { var->data.explicit_location = true; @@ -2122,7 +2111,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual, * ensures that negative values stay negative. */ if (qual->location >= 0) { - var->data.location = (state->target == MESA_SHADER_VERTEX) + var->data.location = (state->stage == MESA_SHADER_VERTEX) ? (qual->location + VERT_ATTRIB_GENERIC0) : (qual->location + FRAG_RESULT_DATA0); } else { @@ -2174,7 +2163,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (qual->flags.q.constant || qual->flags.q.attribute || qual->flags.q.uniform - || (qual->flags.q.varying && (state->target == MESA_SHADER_FRAGMENT))) + || (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT))) var->data.read_only = 1; if (qual->flags.q.centroid) @@ -2183,12 +2172,12 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (qual->flags.q.sample) var->data.sample = 1; - if (qual->flags.q.attribute && state->target != MESA_SHADER_VERTEX) { + if (qual->flags.q.attribute && state->stage != MESA_SHADER_VERTEX) { var->type = glsl_type::error_type; _mesa_glsl_error(loc, state, "`attribute' variables may not be declared in the " "%s shader", - _mesa_shader_type_to_string(state->target)); + _mesa_shader_stage_to_string(state->stage)); } /* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says: @@ -2214,16 +2203,16 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, else if (qual->flags.q.in) var->data.mode = is_parameter ? ir_var_function_in : ir_var_shader_in; else if (qual->flags.q.attribute - || (qual->flags.q.varying && (state->target == MESA_SHADER_FRAGMENT))) + || (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT))) var->data.mode = ir_var_shader_in; else if (qual->flags.q.out) var->data.mode = is_parameter ? ir_var_function_out : ir_var_shader_out; - else if (qual->flags.q.varying && (state->target == MESA_SHADER_VERTEX)) + else if (qual->flags.q.varying && (state->stage == MESA_SHADER_VERTEX)) var->data.mode = ir_var_shader_out; else if (qual->flags.q.uniform) var->data.mode = ir_var_uniform; - if (!is_parameter && is_varying_var(var, state->target)) { + if (!is_parameter && is_varying_var(var, state->stage)) { /* This variable is being used to link data between shader stages (in * pre-glsl-1.30 parlance, it's a "varying"). Check that it has a type * that is allowed for such purposes. @@ -2272,7 +2261,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, } if (state->all_invariant && (state->current_function == NULL)) { - switch (state->target) { + switch (state->stage) { case MESA_SHADER_VERTEX: if (var->data.mode == ir_var_shader_out) var->data.invariant = true; @@ -2599,8 +2588,8 @@ process_initializer(ir_variable *var, ast_declaration *decl, if ((var->data.mode == ir_var_shader_in) && (state->current_function == NULL)) { _mesa_glsl_error(& initializer_loc, state, "cannot initialize %s shader input / %s", - _mesa_shader_type_to_string(state->target), - (state->target == MESA_SHADER_VERTEX) + _mesa_shader_stage_to_string(state->stage), + (state->stage == MESA_SHADER_VERTEX) ? "attribute" : "varying"); } @@ -2844,12 +2833,12 @@ ast_declarator_list::hir(exec_list *instructions, _mesa_glsl_error(& loc, state, "undeclared variable `%s' cannot be marked " "invariant", decl->identifier); - } else if ((state->target == MESA_SHADER_VERTEX) + } else if ((state->stage == MESA_SHADER_VERTEX) && (earlier->data.mode != ir_var_shader_out)) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, vertex shader " "outputs only", decl->identifier); - } else if ((state->target == MESA_SHADER_FRAGMENT) + } else if ((state->stage == MESA_SHADER_FRAGMENT) && (earlier->data.mode != ir_var_shader_in)) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, fragment shader " @@ -3034,12 +3023,12 @@ ast_declarator_list::hir(exec_list *instructions, & loc, false); if (this->type->qualifier.flags.q.invariant) { - if ((state->target == MESA_SHADER_VERTEX) && + if ((state->stage == MESA_SHADER_VERTEX) && var->data.mode != ir_var_shader_out) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, vertex shader " "outputs only", var->name); - } else if ((state->target == MESA_SHADER_FRAGMENT) && + } else if ((state->stage == MESA_SHADER_FRAGMENT) && var->data.mode != ir_var_shader_in) { /* FINISHME: Note that this doesn't work for invariant on * a function signature inval @@ -3080,7 +3069,7 @@ ast_declarator_list::hir(exec_list *instructions, } else if (var->data.mode == ir_var_shader_in) { var->data.read_only = true; - if (state->target == MESA_SHADER_VERTEX) { + if (state->stage == MESA_SHADER_VERTEX) { bool error_emitted = false; /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: @@ -3135,7 +3124,7 @@ ast_declarator_list::hir(exec_list *instructions, "cannot have array type")) { error_emitted = true; } - } else if (state->target == MESA_SHADER_GEOMETRY) { + } else if (state->stage == MESA_SHADER_GEOMETRY) { /* From section 4.3.4 (Inputs) of the GLSL 1.50 spec: * * Geometry shader input variables get the per-vertex values @@ -3185,10 +3174,10 @@ ast_declarator_list::hir(exec_list *instructions, if (state->is_version(130, 300) && var->type->contains_integer() && var->data.interpolation != INTERP_QUALIFIER_FLAT && - ((state->target == MESA_SHADER_FRAGMENT && var->data.mode == ir_var_shader_in) - || (state->target == MESA_SHADER_VERTEX && var->data.mode == ir_var_shader_out + ((state->stage == MESA_SHADER_FRAGMENT && var->data.mode == ir_var_shader_in) + || (state->stage == MESA_SHADER_VERTEX && var->data.mode == ir_var_shader_out && state->es_shader))) { - const char *var_type = (state->target == MESA_SHADER_VERTEX) ? + const char *var_type = (state->stage == MESA_SHADER_VERTEX) ? "vertex output" : "fragment input"; _mesa_glsl_error(&loc, state, "if a %s is (or contains) " "an integer, then it must be qualified with 'flat'", @@ -3244,7 +3233,7 @@ ast_declarator_list::hir(exec_list *instructions, const char *i = this->type->qualifier.interpolation_string(); assert(i != NULL); - switch (state->target) { + switch (state->stage) { case MESA_SHADER_VERTEX: if (this->type->qualifier.flags.q.in) { _mesa_glsl_error(&loc, state, @@ -3275,13 +3264,13 @@ ast_declarator_list::hir(exec_list *instructions, if (state->is_version(130, 300) && this->type->qualifier.flags.q.centroid && this->type->qualifier.flags.q.in - && state->target == MESA_SHADER_VERTEX) { + && state->stage == MESA_SHADER_VERTEX) { _mesa_glsl_error(&loc, state, "'centroid in' cannot be used in a vertex shader"); } - if (state->target == MESA_SHADER_VERTEX + if (state->stage == MESA_SHADER_VERTEX && this->type->qualifier.flags.q.sample && this->type->qualifier.flags.q.in) { @@ -3296,7 +3285,7 @@ ast_declarator_list::hir(exec_list *instructions, * "It is an error to use auxiliary storage qualifiers or interpolation * qualifiers on an output in a fragment shader." */ - if (state->target == MESA_SHADER_FRAGMENT && + if (state->stage == MESA_SHADER_FRAGMENT && this->type->qualifier.flags.q.out && this->type->qualifier.has_auxiliary_storage()) { _mesa_glsl_error(&loc, state, @@ -3829,8 +3818,8 @@ ast_function_definition::hir(exec_list *instructions, * Add these to the symbol table. */ state->symbols->push_scope(); - foreach_iter(exec_list_iterator, iter, signature->parameters) { - ir_variable *const var = ((ir_instruction *) iter.get())->as_variable(); + foreach_list(n, &signature->parameters) { + ir_variable *const var = ((ir_instruction *) n)->as_variable(); assert(var != NULL); @@ -3954,7 +3943,7 @@ ast_jump_statement::hir(exec_list *instructions, } case ast_discard: - if (state->target != MESA_SHADER_FRAGMENT) { + if (state->stage != MESA_SHADER_FRAGMENT) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, @@ -4492,7 +4481,7 @@ ast_type_specifier::hir(exec_list *instructions, if (type->base_type == GLSL_TYPE_FLOAT && state->es_shader - && state->target == MESA_SHADER_FRAGMENT) { + && state->stage == MESA_SHADER_FRAGMENT) { /* Section 4.5.3 (Default Precision Qualifiers) of the GLSL ES 1.00 * spec says: * @@ -4890,7 +4879,7 @@ ast_interface_block::hir(exec_list *instructions, _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex input not allowed " "in the %s shader", - _mesa_shader_type_to_string(state->target)); + _mesa_shader_stage_to_string(state->stage)); } if (this->instance_name == NULL || strcmp(this->instance_name, "gl_in") != 0 || !this->is_array) { @@ -4907,7 +4896,7 @@ ast_interface_block::hir(exec_list *instructions, _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex output not " "allowed in the %s shader", - _mesa_shader_type_to_string(state->target)); + _mesa_shader_stage_to_string(state->stage)); } if (this->instance_name != NULL) { _mesa_glsl_error(&loc, state, @@ -4995,7 +4984,7 @@ ast_interface_block::hir(exec_list *instructions, * variable (or input block, see interface blocks below) needs to be * declared as an array. */ - if (state->target == MESA_SHADER_GEOMETRY && !this->is_array && + if (state->stage == MESA_SHADER_GEOMETRY && !this->is_array && var_mode == ir_var_shader_in) { _mesa_glsl_error(&loc, state, "geometry shader inputs must be arrays"); } @@ -5050,7 +5039,7 @@ ast_interface_block::hir(exec_list *instructions, * geometry shader input. */ if (this->array_size == NULL && - (state->target != MESA_SHADER_GEOMETRY || !this->layout.flags.q.in)) { + (state->stage != MESA_SHADER_GEOMETRY || !this->layout.flags.q.in)) { _mesa_glsl_error(&loc, state, "only geometry shader inputs may be unsized " "instance block arrays"); @@ -5069,7 +5058,7 @@ ast_interface_block::hir(exec_list *instructions, var_mode); } - if (state->target == MESA_SHADER_GEOMETRY && var_mode == ir_var_shader_in) + if (state->stage == MESA_SHADER_GEOMETRY && var_mode == ir_var_shader_in) handle_geometry_shader_input_decl(state, loc, var); if (ir_variable *earlier = @@ -5265,7 +5254,7 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, else if (strcmp(var->name, "gl_FragData") == 0) gl_FragData_assigned = true; else if (strncmp(var->name, "gl_", 3) != 0) { - if (state->target == MESA_SHADER_FRAGMENT && + if (state->stage == MESA_SHADER_FRAGMENT && var->data.mode == ir_var_shader_out) { user_defined_fs_output_assigned = true; user_defined_fs_output = var; diff --git a/mesalib/src/glsl/builtin_functions.cpp b/mesalib/src/glsl/builtin_functions.cpp index f22ace19d..b1065f48d 100644..100755 --- a/mesalib/src/glsl/builtin_functions.cpp +++ b/mesalib/src/glsl/builtin_functions.cpp @@ -77,7 +77,7 @@ always_available(const _mesa_glsl_parse_state *state) static bool compatibility_vs_only(const _mesa_glsl_parse_state *state) { - return state->target == MESA_SHADER_VERTEX && + return state->stage == MESA_SHADER_VERTEX && state->language_version <= 130 && !state->es_shader; } @@ -85,13 +85,13 @@ compatibility_vs_only(const _mesa_glsl_parse_state *state) static bool fs_only(const _mesa_glsl_parse_state *state) { - return state->target == MESA_SHADER_FRAGMENT; + return state->stage == MESA_SHADER_FRAGMENT; } static bool gs_only(const _mesa_glsl_parse_state *state) { - return state->target == MESA_SHADER_GEOMETRY; + return state->stage == MESA_SHADER_GEOMETRY; } static bool @@ -103,7 +103,7 @@ v110(const _mesa_glsl_parse_state *state) static bool v110_fs_only(const _mesa_glsl_parse_state *state) { - return !state->es_shader && state->target == MESA_SHADER_FRAGMENT; + return !state->es_shader && state->stage == MESA_SHADER_FRAGMENT; } static bool @@ -122,7 +122,7 @@ static bool v130_fs_only(const _mesa_glsl_parse_state *state) { return state->is_version(130, 300) && - state->target == MESA_SHADER_FRAGMENT; + state->stage == MESA_SHADER_FRAGMENT; } static bool @@ -155,7 +155,7 @@ lod_exists_in_stage(const _mesa_glsl_parse_state *state) * Since ARB_shader_texture_lod can only be enabled on desktop GLSL, we * don't need to explicitly check state->es_shader. */ - return state->target == MESA_SHADER_VERTEX || + return state->stage == MESA_SHADER_VERTEX || state->is_version(130, 300) || state->ARB_shader_texture_lod_enable; } @@ -223,7 +223,7 @@ texture_array_lod(const _mesa_glsl_parse_state *state) static bool fs_texture_array(const _mesa_glsl_parse_state *state) { - return state->target == MESA_SHADER_FRAGMENT && + return state->stage == MESA_SHADER_FRAGMENT && state->EXT_texture_array_enable; } @@ -243,7 +243,7 @@ texture_multisample(const _mesa_glsl_parse_state *state) static bool fs_texture_cube_map_array(const _mesa_glsl_parse_state *state) { - return state->target == MESA_SHADER_FRAGMENT && + return state->stage == MESA_SHADER_FRAGMENT && (state->is_version(400, 0) || state->ARB_texture_cube_map_array_enable); } @@ -265,7 +265,7 @@ texture_query_levels(const _mesa_glsl_parse_state *state) static bool texture_query_lod(const _mesa_glsl_parse_state *state) { - return state->target == MESA_SHADER_FRAGMENT && + return state->stage == MESA_SHADER_FRAGMENT && state->ARB_texture_query_lod_enable; } @@ -292,7 +292,7 @@ texture_gather_only(const _mesa_glsl_parse_state *state) static bool fs_oes_derivatives(const _mesa_glsl_parse_state *state) { - return state->target == MESA_SHADER_FRAGMENT && + return state->stage == MESA_SHADER_FRAGMENT && (state->is_version(110, 300) || state->OES_standard_derivatives_enable); } @@ -318,7 +318,7 @@ tex3d(const _mesa_glsl_parse_state *state) static bool fs_tex3d(const _mesa_glsl_parse_state *state) { - return state->target == MESA_SHADER_FRAGMENT && + return state->stage == MESA_SHADER_FRAGMENT && (!state->es_shader || state->OES_texture_3D_enable); } @@ -334,6 +334,12 @@ shader_atomic_counters(const _mesa_glsl_parse_state *state) return state->ARB_shader_atomic_counters_enable; } +static bool +shader_trinary_minmax(const _mesa_glsl_parse_state *state) +{ + return state->AMD_shader_trinary_minmax_enable; +} + /** @} */ /******************************************************************************/ @@ -570,6 +576,21 @@ private: ir_function_signature *_atomic_op(const char *intrinsic, builtin_available_predicate avail); + ir_function_signature *_min3(builtin_available_predicate avail, + const glsl_type *x_type, + const glsl_type *y_type, + const glsl_type *z_type); + + ir_function_signature *_max3(builtin_available_predicate avail, + const glsl_type *x_type, + const glsl_type *y_type, + const glsl_type *z_type); + + ir_function_signature *_mid3(builtin_available_predicate avail, + const glsl_type *x_type, + const glsl_type *y_type, + const glsl_type *z_type); + #undef B0 #undef B1 #undef B2 @@ -2106,6 +2127,57 @@ builtin_builder::create_builtins() shader_atomic_counters), NULL); + add_function("min3", + _min3(shader_trinary_minmax, glsl_type::float_type, glsl_type::float_type, glsl_type::float_type), + _min3(shader_trinary_minmax, glsl_type::vec2_type, glsl_type::vec2_type, glsl_type::vec2_type), + _min3(shader_trinary_minmax, glsl_type::vec3_type, glsl_type::vec3_type, glsl_type::vec3_type), + _min3(shader_trinary_minmax, glsl_type::vec4_type, glsl_type::vec4_type, glsl_type::vec4_type), + + _min3(shader_trinary_minmax, glsl_type::int_type, glsl_type::int_type, glsl_type::int_type), + _min3(shader_trinary_minmax, glsl_type::ivec2_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + _min3(shader_trinary_minmax, glsl_type::ivec3_type, glsl_type::ivec3_type, glsl_type::ivec3_type), + _min3(shader_trinary_minmax, glsl_type::ivec4_type, glsl_type::ivec4_type, glsl_type::ivec4_type), + + _min3(shader_trinary_minmax, glsl_type::uint_type, glsl_type::uint_type, glsl_type::uint_type), + _min3(shader_trinary_minmax, glsl_type::uvec2_type, glsl_type::uvec2_type, glsl_type::uvec2_type), + _min3(shader_trinary_minmax, glsl_type::uvec3_type, glsl_type::uvec3_type, glsl_type::uvec3_type), + _min3(shader_trinary_minmax, glsl_type::uvec4_type, glsl_type::uvec4_type, glsl_type::uvec4_type), + NULL); + + add_function("max3", + _max3(shader_trinary_minmax, glsl_type::float_type, glsl_type::float_type, glsl_type::float_type), + _max3(shader_trinary_minmax, glsl_type::vec2_type, glsl_type::vec2_type, glsl_type::vec2_type), + _max3(shader_trinary_minmax, glsl_type::vec3_type, glsl_type::vec3_type, glsl_type::vec3_type), + _max3(shader_trinary_minmax, glsl_type::vec4_type, glsl_type::vec4_type, glsl_type::vec4_type), + + _max3(shader_trinary_minmax, glsl_type::int_type, glsl_type::int_type, glsl_type::int_type), + _max3(shader_trinary_minmax, glsl_type::ivec2_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + _max3(shader_trinary_minmax, glsl_type::ivec3_type, glsl_type::ivec3_type, glsl_type::ivec3_type), + _max3(shader_trinary_minmax, glsl_type::ivec4_type, glsl_type::ivec4_type, glsl_type::ivec4_type), + + _max3(shader_trinary_minmax, glsl_type::uint_type, glsl_type::uint_type, glsl_type::uint_type), + _max3(shader_trinary_minmax, glsl_type::uvec2_type, glsl_type::uvec2_type, glsl_type::uvec2_type), + _max3(shader_trinary_minmax, glsl_type::uvec3_type, glsl_type::uvec3_type, glsl_type::uvec3_type), + _max3(shader_trinary_minmax, glsl_type::uvec4_type, glsl_type::uvec4_type, glsl_type::uvec4_type), + NULL); + + add_function("mid3", + _mid3(shader_trinary_minmax, glsl_type::float_type, glsl_type::float_type, glsl_type::float_type), + _mid3(shader_trinary_minmax, glsl_type::vec2_type, glsl_type::vec2_type, glsl_type::vec2_type), + _mid3(shader_trinary_minmax, glsl_type::vec3_type, glsl_type::vec3_type, glsl_type::vec3_type), + _mid3(shader_trinary_minmax, glsl_type::vec4_type, glsl_type::vec4_type, glsl_type::vec4_type), + + _mid3(shader_trinary_minmax, glsl_type::int_type, glsl_type::int_type, glsl_type::int_type), + _mid3(shader_trinary_minmax, glsl_type::ivec2_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + _mid3(shader_trinary_minmax, glsl_type::ivec3_type, glsl_type::ivec3_type, glsl_type::ivec3_type), + _mid3(shader_trinary_minmax, glsl_type::ivec4_type, glsl_type::ivec4_type, glsl_type::ivec4_type), + + _mid3(shader_trinary_minmax, glsl_type::uint_type, glsl_type::uint_type, glsl_type::uint_type), + _mid3(shader_trinary_minmax, glsl_type::uvec2_type, glsl_type::uvec2_type, glsl_type::uvec2_type), + _mid3(shader_trinary_minmax, glsl_type::uvec3_type, glsl_type::uvec3_type, glsl_type::uvec3_type), + _mid3(shader_trinary_minmax, glsl_type::uvec4_type, glsl_type::uvec4_type, glsl_type::uvec4_type), + NULL); + #undef F #undef FI #undef FIU @@ -2326,8 +2398,8 @@ builtin_builder::call(ir_function *f, ir_variable *ret, exec_list params) { exec_list actual_params; - foreach_iter(exec_list_iterator, it, params) { - ir_variable *var = ((ir_instruction *)it.get())->as_variable(); + foreach_list(node, ¶ms) { + ir_variable *var = (ir_variable *) node; actual_params.push_tail(var_ref(var)); } @@ -3864,7 +3936,7 @@ builtin_builder::_fma_mesa(const glsl_type *type) ir_variable *c = in_var(type, "c"); MAKE_SIG(type, gpu_shader5, 3, a, b, c); - body.emit(ret(fma_mesa(a, b, c))); + body.emit(ret(ir_builder::fma(a, b, c))); return sig; } @@ -3991,6 +4063,54 @@ builtin_builder::_atomic_op(const char *intrinsic, return sig; } +ir_function_signature * +builtin_builder::_min3(builtin_available_predicate avail, + const glsl_type *x_type, const glsl_type *y_type, + const glsl_type *z_type) +{ + ir_variable *x = in_var(x_type, "x"); + ir_variable *y = in_var(y_type, "y"); + ir_variable *z = in_var(z_type, "z"); + MAKE_SIG(x_type, avail, 3, x, y, z); + + ir_expression *min3 = min2(x, min2(y,z)); + body.emit(ret(min3)); + + return sig; +} + +ir_function_signature * +builtin_builder::_max3(builtin_available_predicate avail, + const glsl_type *x_type, const glsl_type *y_type, + const glsl_type *z_type) +{ + ir_variable *x = in_var(x_type, "x"); + ir_variable *y = in_var(y_type, "y"); + ir_variable *z = in_var(z_type, "z"); + MAKE_SIG(x_type, avail, 3, x, y, z); + + ir_expression *max3 = max2(x, max2(y,z)); + body.emit(ret(max3)); + + return sig; +} + +ir_function_signature * +builtin_builder::_mid3(builtin_available_predicate avail, + const glsl_type *x_type, const glsl_type *y_type, + const glsl_type *z_type) +{ + ir_variable *x = in_var(x_type, "x"); + ir_variable *y = in_var(y_type, "y"); + ir_variable *z = in_var(z_type, "z"); + MAKE_SIG(x_type, avail, 3, x, y, z); + + ir_expression *mid3 = max2(min2(x, y), max2(min2(x, z), min2(y, z))); + body.emit(ret(mid3)); + + return sig; +} + /** @} */ /******************************************************************************/ diff --git a/mesalib/src/glsl/builtin_variables.cpp b/mesalib/src/glsl/builtin_variables.cpp index ff9acb8d0..f630923ed 100644 --- a/mesalib/src/glsl/builtin_variables.cpp +++ b/mesalib/src/glsl/builtin_variables.cpp @@ -554,9 +554,9 @@ builtin_variable_generator::generate_constants() */ if (state->is_version(0, 300)) { add_const("gl_MaxVertexOutputVectors", - state->ctx->Const.VertexProgram.MaxOutputComponents / 4); + state->ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4); add_const("gl_MaxFragmentInputVectors", - state->ctx->Const.FragmentProgram.MaxInputComponents / 4); + state->ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4); } else { add_const("gl_MaxVaryingVectors", state->ctx->Const.MaxVarying); @@ -876,7 +876,7 @@ builtin_variable_generator::add_varying(int slot, const glsl_type *type, const char *name, const char *name_as_gs_input) { - switch (state->target) { + switch (state->stage) { case MESA_SHADER_GEOMETRY: this->per_vertex_in.add_field(slot, type, name); /* FALLTHROUGH */ @@ -901,7 +901,7 @@ builtin_variable_generator::generate_varyings() add_varying(loc, type, name, name "In") /* gl_Position and gl_PointSize are not visible from fragment shaders. */ - if (state->target != MESA_SHADER_FRAGMENT) { + if (state->stage != MESA_SHADER_FRAGMENT) { ADD_VARYING(VARYING_SLOT_POS, vec4_t, "gl_Position"); ADD_VARYING(VARYING_SLOT_PSIZ, float_t, "gl_PointSize"); } @@ -914,7 +914,7 @@ builtin_variable_generator::generate_varyings() if (compatibility) { ADD_VARYING(VARYING_SLOT_TEX0, array(vec4_t, 0), "gl_TexCoord"); ADD_VARYING(VARYING_SLOT_FOGC, float_t, "gl_FogFragCoord"); - if (state->target == MESA_SHADER_FRAGMENT) { + if (state->stage == MESA_SHADER_FRAGMENT) { ADD_VARYING(VARYING_SLOT_COL0, vec4_t, "gl_Color"); ADD_VARYING(VARYING_SLOT_COL1, vec4_t, "gl_SecondaryColor"); } else { @@ -926,13 +926,13 @@ builtin_variable_generator::generate_varyings() } } - if (state->target == MESA_SHADER_GEOMETRY) { + if (state->stage == MESA_SHADER_GEOMETRY) { const glsl_type *per_vertex_in_type = this->per_vertex_in.construct_interface_instance(); add_variable("gl_in", array(per_vertex_in_type, 0), ir_var_shader_in, -1); } - if (state->target == MESA_SHADER_VERTEX || state->target == MESA_SHADER_GEOMETRY) { + if (state->stage == MESA_SHADER_VERTEX || state->stage == MESA_SHADER_GEOMETRY) { const glsl_type *per_vertex_out_type = this->per_vertex_out.construct_interface_instance(); const glsl_struct_field *fields = per_vertex_out_type->fields.structure; @@ -963,7 +963,7 @@ _mesa_glsl_initialize_variables(exec_list *instructions, gen.generate_varyings(); - switch (state->target) { + switch (state->stage) { case MESA_SHADER_VERTEX: gen.generate_vs_special_vars(); break; diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y index ef084b639..55c498195 100644 --- a/mesalib/src/glsl/glcpp/glcpp-parse.y +++ b/mesalib/src/glsl/glcpp/glcpp-parse.y @@ -1281,6 +1281,9 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) if (extensions->ARB_shader_atomic_counters) add_builtin_define(parser, "GL_ARB_shader_atomic_counters", 1); + + if (extensions->AMD_shader_trinary_minmax) + add_builtin_define(parser, "GL_AMD_shader_trinary_minmax", 1); } } diff --git a/mesalib/src/glsl/glsl_parser.yy b/mesalib/src/glsl/glsl_parser.yy index 6cd129cae..52f674b63 100644 --- a/mesalib/src/glsl/glsl_parser.yy +++ b/mesalib/src/glsl/glsl_parser.yy @@ -2220,11 +2220,11 @@ basic_interface_block: * "It is illegal to have an input block in a vertex shader * or an output block in a fragment shader" */ - if ((state->target == MESA_SHADER_VERTEX) && $1.flags.q.in) { + if ((state->stage == MESA_SHADER_VERTEX) && $1.flags.q.in) { _mesa_glsl_error(& @1, state, "`in' interface block is not allowed for " "a vertex shader"); - } else if ((state->target == MESA_SHADER_FRAGMENT) && $1.flags.q.out) { + } else if ((state->stage == MESA_SHADER_FRAGMENT) && $1.flags.q.out) { _mesa_glsl_error(& @1, state, "`out' interface block is not allowed for " "a fragment shader"); @@ -2378,7 +2378,7 @@ layout_defaults: { void *ctx = state; $$ = NULL; - if (state->target != MESA_SHADER_GEOMETRY) { + if (state->stage != MESA_SHADER_GEOMETRY) { _mesa_glsl_error(& @1, state, "input layout qualifiers only valid in " "geometry shaders"); @@ -2406,7 +2406,7 @@ layout_defaults: | layout_qualifier OUT_TOK ';' { - if (state->target != MESA_SHADER_GEOMETRY) { + if (state->stage != MESA_SHADER_GEOMETRY) { _mesa_glsl_error(& @1, state, "out layout qualifiers only valid in " "geometry shaders"); diff --git a/mesalib/src/glsl/glsl_parser_extras.cpp b/mesalib/src/glsl/glsl_parser_extras.cpp index fc9a8b204..21dc3abd7 100644 --- a/mesalib/src/glsl/glsl_parser_extras.cpp +++ b/mesalib/src/glsl/glsl_parser_extras.cpp @@ -54,14 +54,12 @@ static unsigned known_desktop_glsl_versions[] = _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, - GLenum target, void *mem_ctx) + gl_shader_stage stage, + void *mem_ctx) : ctx(_ctx), switch_state() { - switch (target) { - case GL_VERTEX_SHADER: this->target = MESA_SHADER_VERTEX; break; - case GL_FRAGMENT_SHADER: this->target = MESA_SHADER_FRAGMENT; break; - case GL_GEOMETRY_SHADER: this->target = MESA_SHADER_GEOMETRY; break; - } + assert(stage < MESA_SHADER_STAGES); + this->stage = stage; this->scanner = NULL; this->translation_unit.make_empty(); @@ -98,30 +96,30 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes; this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits; this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits; - this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs; - this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents; - this->Const.MaxVertexTextureImageUnits = ctx->Const.VertexProgram.MaxTextureImageUnits; + this->Const.MaxVertexAttribs = ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs; + this->Const.MaxVertexUniformComponents = ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents; + this->Const.MaxVertexTextureImageUnits = ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits; this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits; - this->Const.MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits; - this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents; + this->Const.MaxTextureImageUnits = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; + this->Const.MaxFragmentUniformComponents = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents; this->Const.MinProgramTexelOffset = ctx->Const.MinProgramTexelOffset; this->Const.MaxProgramTexelOffset = ctx->Const.MaxProgramTexelOffset; this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers; /* 1.50 constants */ - this->Const.MaxVertexOutputComponents = ctx->Const.VertexProgram.MaxOutputComponents; - this->Const.MaxGeometryInputComponents = ctx->Const.GeometryProgram.MaxInputComponents; - this->Const.MaxGeometryOutputComponents = ctx->Const.GeometryProgram.MaxOutputComponents; - this->Const.MaxFragmentInputComponents = ctx->Const.FragmentProgram.MaxInputComponents; - this->Const.MaxGeometryTextureImageUnits = ctx->Const.GeometryProgram.MaxTextureImageUnits; + this->Const.MaxVertexOutputComponents = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + this->Const.MaxGeometryInputComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents; + this->Const.MaxGeometryOutputComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents; + this->Const.MaxFragmentInputComponents = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents; + this->Const.MaxGeometryTextureImageUnits = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits; this->Const.MaxGeometryOutputVertices = ctx->Const.MaxGeometryOutputVertices; this->Const.MaxGeometryTotalOutputComponents = ctx->Const.MaxGeometryTotalOutputComponents; - this->Const.MaxGeometryUniformComponents = ctx->Const.GeometryProgram.MaxUniformComponents; + this->Const.MaxGeometryUniformComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents; - this->Const.MaxVertexAtomicCounters = ctx->Const.VertexProgram.MaxAtomicCounters; - this->Const.MaxGeometryAtomicCounters = ctx->Const.GeometryProgram.MaxAtomicCounters; - this->Const.MaxFragmentAtomicCounters = ctx->Const.FragmentProgram.MaxAtomicCounters; + this->Const.MaxVertexAtomicCounters = ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters; + this->Const.MaxGeometryAtomicCounters = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters; + this->Const.MaxFragmentAtomicCounters = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters; this->Const.MaxCombinedAtomicCounters = ctx->Const.MaxCombinedAtomicCounters; this->Const.MaxAtomicBufferBindings = ctx->Const.MaxAtomicBufferBindings; @@ -331,44 +329,15 @@ _mesa_glsl_parse_state::process_version_directive(YYLTYPE *locp, int version, } } -extern "C" { - -/** - * Translate a GLenum to a short shader stage name for debug printouts and - * error messages. - * - * It recognizes the PROGRAM variants of the names so it can be used - * with a struct gl_program->Target, not just a struct - * gl_shader->Type. - */ -const char * -_mesa_shader_enum_to_string(GLenum type) -{ - switch (type) { - case GL_VERTEX_SHADER: - case GL_VERTEX_PROGRAM_ARB: - return "vertex"; - case GL_FRAGMENT_SHADER: - case GL_FRAGMENT_PROGRAM_ARB: - return "fragment"; - case GL_GEOMETRY_SHADER: - return "geometry"; - default: - assert(!"Should not get here."); - return "unknown"; - } -} - -} /* extern "C" */ /** - * Translate a gl_shader_type to a short shader stage name for debug printouts - * and error messages. + * Translate a gl_shader_stage to a short shader stage name for debug + * printouts and error messages. */ const char * -_mesa_shader_type_to_string(unsigned target) +_mesa_shader_stage_to_string(unsigned stage) { - switch (target) { + switch (stage) { case MESA_SHADER_VERTEX: return "vertex"; case MESA_SHADER_FRAGMENT: return "fragment"; case MESA_SHADER_GEOMETRY: return "geometry"; @@ -543,6 +512,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(ARB_texture_gather, true, false, ARB_texture_gather), EXT(ARB_shader_atomic_counters, true, false, ARB_shader_atomic_counters), EXT(ARB_sample_shading, true, false, ARB_sample_shading), + EXT(AMD_shader_trinary_minmax, true, false, dummy_true), }; #undef EXT @@ -650,11 +620,11 @@ _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, if (behavior == extension_require) { _mesa_glsl_error(name_locp, state, fmt, - name, _mesa_shader_type_to_string(state->target)); + name, _mesa_shader_stage_to_string(state->stage)); return false; } else { _mesa_glsl_warning(name_locp, state, fmt, - name, _mesa_shader_type_to_string(state->target)); + name, _mesa_shader_stage_to_string(state->stage)); } } } @@ -1447,7 +1417,7 @@ static void set_shader_inout_layout(struct gl_shader *shader, struct _mesa_glsl_parse_state *state) { - if (shader->Type != GL_GEOMETRY_SHADER) { + if (shader->Stage != MESA_SHADER_GEOMETRY) { /* Should have been prevented by the parser. */ assert(!state->gs_input_prim_type_specified); assert(!state->out_qualifier->flags.i); @@ -1478,7 +1448,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, bool dump_ast, bool dump_hir) { struct _mesa_glsl_parse_state *state = - new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader); + new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader); const char *source = shader->Source; state->error = glcpp_preprocess(state, &source, &state->info_log, @@ -1515,7 +1485,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, if (!state->error && !shader->ir->is_empty()) { struct gl_shader_compiler_options *options = - &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)]; + &ctx->ShaderCompilerOptions[shader->Stage]; /* Do some optimization at compile time to reduce shader IR size * and reduce later work if the same shader is linked multiple times diff --git a/mesalib/src/glsl/glsl_parser_extras.h b/mesalib/src/glsl/glsl_parser_extras.h index 6cfa2d661..21a27c9ea 100644 --- a/mesalib/src/glsl/glsl_parser_extras.h +++ b/mesalib/src/glsl/glsl_parser_extras.h @@ -68,7 +68,7 @@ extern void _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state, struct _mesa_glsl_parse_state { - _mesa_glsl_parse_state(struct gl_context *_ctx, GLenum target, + _mesa_glsl_parse_state(struct gl_context *_ctx, gl_shader_stage stage, void *mem_ctx); DECLARE_RALLOC_CXX_OPERATORS(_mesa_glsl_parse_state); @@ -169,7 +169,7 @@ struct _mesa_glsl_parse_state { bool es_shader; unsigned language_version; - gl_shader_type target; + gl_shader_stage stage; /** * Number of nested struct_specifier levels @@ -354,6 +354,8 @@ struct _mesa_glsl_parse_state { bool EXT_shader_integer_mix_warn; bool ARB_shader_atomic_counters_enable; bool ARB_shader_atomic_counters_warn; + bool AMD_shader_trinary_minmax_enable; + bool AMD_shader_trinary_minmax_warn; /*@}*/ /** Extensions supported by the OpenGL implementation. */ @@ -425,14 +427,6 @@ extern bool _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, YYLTYPE *behavior_locp, _mesa_glsl_parse_state *state); -/** - * Get the textual name of the specified shader target (which is a - * gl_shader_type). - */ -extern const char * -_mesa_shader_type_to_string(unsigned target); - - #endif /* __cplusplus */ @@ -443,8 +437,12 @@ _mesa_shader_type_to_string(unsigned target); extern "C" { #endif +/** + * Get the textual name of the specified shader stage (which is a + * gl_shader_stage). + */ extern const char * -_mesa_shader_enum_to_string(GLenum type); +_mesa_shader_stage_to_string(unsigned stage); extern int glcpp_preprocess(void *ctx, const char **shader, char **info_log, const struct gl_extensions *extensions, struct gl_context *gl_ctx); diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp index 8af58b847..77638ef26 100644 --- a/mesalib/src/glsl/ir.cpp +++ b/mesalib/src/glsl/ir.cpp @@ -1122,27 +1122,31 @@ ir_constant::has_value(const ir_constant *c) const } bool -ir_constant::is_zero() const +ir_constant::is_value(float f, int i) const { if (!this->type->is_scalar() && !this->type->is_vector()) return false; + /* Only accept boolean values for 0/1. */ + if (int(bool(i)) != i && this->type->is_boolean()) + return false; + for (unsigned c = 0; c < this->type->vector_elements; c++) { switch (this->type->base_type) { case GLSL_TYPE_FLOAT: - if (this->value.f[c] != 0.0) + if (this->value.f[c] != f) return false; break; case GLSL_TYPE_INT: - if (this->value.i[c] != 0) + if (this->value.i[c] != i) return false; break; case GLSL_TYPE_UINT: - if (this->value.u[c] != 0) + if (this->value.u[c] != unsigned(i)) return false; break; case GLSL_TYPE_BOOL: - if (this->value.b[c] != false) + if (this->value.b[c] != bool(i)) return false; break; default: @@ -1159,76 +1163,21 @@ ir_constant::is_zero() const } bool -ir_constant::is_one() const +ir_constant::is_zero() const { - if (!this->type->is_scalar() && !this->type->is_vector()) - return false; - - for (unsigned c = 0; c < this->type->vector_elements; c++) { - switch (this->type->base_type) { - case GLSL_TYPE_FLOAT: - if (this->value.f[c] != 1.0) - return false; - break; - case GLSL_TYPE_INT: - if (this->value.i[c] != 1) - return false; - break; - case GLSL_TYPE_UINT: - if (this->value.u[c] != 1) - return false; - break; - case GLSL_TYPE_BOOL: - if (this->value.b[c] != true) - return false; - break; - default: - /* The only other base types are structures, arrays, and samplers. - * Samplers cannot be constants, and the others should have been - * filtered out above. - */ - assert(!"Should not get here."); - return false; - } - } + return is_value(0.0, 0); +} - return true; +bool +ir_constant::is_one() const +{ + return is_value(1.0, 1); } bool ir_constant::is_negative_one() const { - if (!this->type->is_scalar() && !this->type->is_vector()) - return false; - - if (this->type->is_boolean()) - return false; - - for (unsigned c = 0; c < this->type->vector_elements; c++) { - switch (this->type->base_type) { - case GLSL_TYPE_FLOAT: - if (this->value.f[c] != -1.0) - return false; - break; - case GLSL_TYPE_INT: - if (this->value.i[c] != -1) - return false; - break; - case GLSL_TYPE_UINT: - if (int(this->value.u[c]) != -1) - return false; - break; - default: - /* The only other base types are structures, arrays, samplers, and - * booleans. Samplers cannot be constants, and the others should - * have been filtered out above. - */ - assert(!"Should not get here."); - return false; - } - } - - return true; + return is_value(-1.0, -1); } bool @@ -1700,13 +1649,10 @@ modes_match(unsigned a, unsigned b) const char * ir_function_signature::qualifiers_match(exec_list *params) { - exec_list_iterator iter_a = parameters.iterator(); - exec_list_iterator iter_b = params->iterator(); - /* check that the qualifiers match. */ - while (iter_a.has_next()) { - ir_variable *a = (ir_variable *)iter_a.get(); - ir_variable *b = (ir_variable *)iter_b.get(); + foreach_two_lists(a_node, &this->parameters, b_node, params) { + ir_variable *a = (ir_variable *) a_node; + ir_variable *b = (ir_variable *) b_node; if (a->data.read_only != b->data.read_only || !modes_match(a->data.mode, b->data.mode) || @@ -1717,9 +1663,6 @@ ir_function_signature::qualifiers_match(exec_list *params) /* parameter a's qualifiers don't match */ return a->name; } - - iter_a.next(); - iter_b.next(); } return NULL; } @@ -1768,8 +1711,8 @@ ir_rvalue::error_value(void *mem_ctx) void visit_exec_list(exec_list *list, ir_visitor *visitor) { - foreach_iter(exec_list_iterator, iter, *list) { - ((ir_instruction *)iter.get())->accept(visitor); + foreach_list_safe(n, list) { + ((ir_instruction *) n)->accept(visitor); } } @@ -1790,8 +1733,8 @@ steal_memory(ir_instruction *ir, void *new_ctx) */ if (constant != NULL) { if (constant->type->is_record()) { - foreach_iter(exec_list_iterator, iter, constant->components) { - ir_constant *field = (ir_constant *)iter.get(); + foreach_list(n, &constant->components) { + ir_constant *field = (ir_constant *) n; steal_memory(field, ir); } } else if (constant->type->is_array()) { diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h index 780959b73..2ae8513a6 100644 --- a/mesalib/src/glsl/ir.h +++ b/mesalib/src/glsl/ir.h @@ -914,14 +914,6 @@ public: } /** - * Get an iterator for the set of function signatures - */ - exec_list_iterator iterator() - { - return signatures.iterator(); - } - - /** * Find a signature that matches a set of actual parameters, taking implicit * conversions into account. Also flags whether the match was exact. */ @@ -1018,14 +1010,6 @@ public: return this; } - /** - * Get an iterator for the instructions of the loop body - */ - exec_list_iterator iterator() - { - return body_instructions.iterator(); - } - /** List of ir_instruction that make up the body of the loop. */ exec_list body_instructions; }; @@ -1521,14 +1505,6 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); /** - * Get an iterator for the set of acutal parameters - */ - exec_list_iterator iterator() - { - return actual_parameters.iterator(); - } - - /** * Get the name of the function being called. */ const char *callee_name() const @@ -2186,6 +2162,12 @@ public: */ bool has_value(const ir_constant *) const; + /** + * Return true if this ir_constant represents the given value. + * + * For vectors, this checks that each component is the given value. + */ + virtual bool is_value(float f, int i) const; virtual bool is_zero() const; virtual bool is_one() const; virtual bool is_negative_one() const; @@ -2345,7 +2327,7 @@ ir_has_call(ir_instruction *ir); extern void do_set_program_inouts(exec_list *instructions, struct gl_program *prog, - GLenum shader_type); + gl_shader_stage shader_stage); extern char * prototype_string(const glsl_type *return_type, const char *name, diff --git a/mesalib/src/glsl/ir_basic_block.cpp b/mesalib/src/glsl/ir_basic_block.cpp index 2cbc682d4..426fda2f2 100644 --- a/mesalib/src/glsl/ir_basic_block.cpp +++ b/mesalib/src/glsl/ir_basic_block.cpp @@ -58,8 +58,8 @@ void call_for_basic_blocks(exec_list *instructions, ir_instruction *leader = NULL; ir_instruction *last = NULL; - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir_if *ir_if; ir_loop *ir_loop; ir_function *ir_function; @@ -90,10 +90,8 @@ void call_for_basic_blocks(exec_list *instructions, * and the body of main(). Perhaps those instructions ought * to live inside of main(). */ - foreach_iter(exec_list_iterator, fun_iter, *ir_function) { - ir_function_signature *ir_sig; - - ir_sig = (ir_function_signature *)fun_iter.get(); + foreach_list(func_node, &ir_function->signatures) { + ir_function_signature *ir_sig = (ir_function_signature *) func_node; call_for_basic_blocks(&ir_sig->body, callback, data); } diff --git a/mesalib/src/glsl/ir_builder.cpp b/mesalib/src/glsl/ir_builder.cpp index 6fd58de0e..1e0dd5419 100644 --- a/mesalib/src/glsl/ir_builder.cpp +++ b/mesalib/src/glsl/ir_builder.cpp @@ -211,6 +211,16 @@ ir_expression *sub(operand a, operand b) return expr(ir_binop_sub, a, b); } +ir_expression *min2(operand a, operand b) +{ + return expr(ir_binop_min, a, b); +} + +ir_expression *max2(operand a, operand b) +{ + return expr(ir_binop_max, a, b); +} + ir_expression *mul(operand a, operand b) { return expr(ir_binop_mul, a, b); diff --git a/mesalib/src/glsl/ir_builder.h b/mesalib/src/glsl/ir_builder.h index 52cc2168f..f00e6f3b3 100644..100755 --- a/mesalib/src/glsl/ir_builder.h +++ b/mesalib/src/glsl/ir_builder.h @@ -184,7 +184,10 @@ ir_expression *i2b(operand a); ir_expression *f2b(operand a); ir_expression *b2f(operand a); -ir_expression *fma_mesa(operand a, operand b, operand c); +ir_expression *min2(operand a, operand b); +ir_expression *max2(operand a, operand b); + +ir_expression *fma(operand a, operand b, operand c); ir_expression *lrp(operand x, operand y, operand a); ir_expression *csel(operand a, operand b, operand c); ir_expression *bitfield_insert(operand a, operand b, operand c, operand d); diff --git a/mesalib/src/glsl/ir_clone.cpp b/mesalib/src/glsl/ir_clone.cpp index 4e5cf68ca..cb732a51a 100644 --- a/mesalib/src/glsl/ir_clone.cpp +++ b/mesalib/src/glsl/ir_clone.cpp @@ -123,13 +123,13 @@ ir_if::clone(void *mem_ctx, struct hash_table *ht) const { ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht)); - foreach_iter(exec_list_iterator, iter, this->then_instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &this->then_instructions) { + ir_instruction *ir = (ir_instruction *) n; new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht)); } - foreach_iter(exec_list_iterator, iter, this->else_instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &this->else_instructions) { + ir_instruction *ir = (ir_instruction *) n; new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht)); } @@ -141,8 +141,8 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const { ir_loop *new_loop = new(mem_ctx) ir_loop(); - foreach_iter(exec_list_iterator, iter, this->body_instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &this->body_instructions) { + ir_instruction *ir = (ir_instruction *) n; new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht)); } @@ -158,8 +158,8 @@ ir_call::clone(void *mem_ctx, struct hash_table *ht) const exec_list new_parameters; - foreach_iter(exec_list_iterator, iter, this->actual_parameters) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &this->actual_parameters) { + ir_instruction *ir = (ir_instruction *) n; new_parameters.push_tail(ir->clone(mem_ctx, ht)); } diff --git a/mesalib/src/glsl/ir_expression_flattening.cpp b/mesalib/src/glsl/ir_expression_flattening.cpp index b44e68ca3..c1cadb122 100644 --- a/mesalib/src/glsl/ir_expression_flattening.cpp +++ b/mesalib/src/glsl/ir_expression_flattening.cpp @@ -59,8 +59,8 @@ do_expression_flattening(exec_list *instructions, { ir_expression_flattening_visitor v(predicate); - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir->accept(&v); } diff --git a/mesalib/src/glsl/ir_function.cpp b/mesalib/src/glsl/ir_function.cpp index bd5318d23..40cf5894a 100644 --- a/mesalib/src/glsl/ir_function.cpp +++ b/mesalib/src/glsl/ir_function.cpp @@ -141,9 +141,8 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state, * multiple ways to apply these conversions to the actual arguments of a * call such that the call can be made to match multiple signatures." */ - foreach_iter(exec_list_iterator, iter, signatures) { - ir_function_signature *const sig = - (ir_function_signature *) iter.get(); + foreach_list(n, &this->signatures) { + ir_function_signature *const sig = (ir_function_signature *) n; /* Skip over any built-ins that aren't available in this shader. */ if (sig->is_builtin() && !sig->is_builtin_available(state)) @@ -212,9 +211,8 @@ ir_function_signature * ir_function::exact_matching_signature(_mesa_glsl_parse_state *state, const exec_list *actual_parameters) { - foreach_iter(exec_list_iterator, iter, signatures) { - ir_function_signature *const sig = - (ir_function_signature *) iter.get(); + foreach_list(n, &this->signatures) { + ir_function_signature *const sig = (ir_function_signature *) n; /* Skip over any built-ins that aren't available in this shader. */ if (sig->is_builtin() && !sig->is_builtin_available(state)) diff --git a/mesalib/src/glsl/ir_print_visitor.cpp b/mesalib/src/glsl/ir_print_visitor.cpp index 01c5f7f1c..935782184 100644 --- a/mesalib/src/glsl/ir_print_visitor.cpp +++ b/mesalib/src/glsl/ir_print_visitor.cpp @@ -61,8 +61,8 @@ _mesa_print_ir(exec_list *instructions, } printf("(\n"); - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir->print(); if (ir->ir_type != ir_type_function) printf("\n"); @@ -179,8 +179,8 @@ void ir_print_visitor::visit(ir_function_signature *ir) printf("(parameters\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->parameters) { - ir_variable *const inst = (ir_variable *) iter.get(); + foreach_list(n, &ir->parameters) { + ir_variable *const inst = (ir_variable *) n; indent(); inst->accept(this); @@ -196,8 +196,8 @@ void ir_print_visitor::visit(ir_function_signature *ir) printf("(\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->body) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->body) { + ir_instruction *const inst = (ir_instruction *) n; indent(); inst->accept(this); @@ -215,8 +215,8 @@ void ir_print_visitor::visit(ir_function *ir) { printf("(function %s\n", ir->name); indentation++; - foreach_iter(exec_list_iterator, iter, *ir) { - ir_function_signature *const sig = (ir_function_signature *) iter.get(); + foreach_list(n, &ir->signatures) { + ir_function_signature *const sig = (ir_function_signature *) n; indent(); sig->accept(this); printf("\n"); @@ -440,10 +440,10 @@ ir_print_visitor::visit(ir_call *ir) if (ir->return_deref) ir->return_deref->accept(this); printf(" ("); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->actual_parameters) { + ir_rvalue *const param = (ir_rvalue *) n; - inst->accept(this); + param->accept(this); } printf("))\n"); } @@ -487,8 +487,8 @@ ir_print_visitor::visit(ir_if *ir) printf("(\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->then_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->then_instructions) { + ir_instruction *const inst = (ir_instruction *) n; indent(); inst->accept(this); @@ -504,8 +504,8 @@ ir_print_visitor::visit(ir_if *ir) printf("(\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->else_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->else_instructions) { + ir_instruction *const inst = (ir_instruction *) n; indent(); inst->accept(this); @@ -526,8 +526,8 @@ ir_print_visitor::visit(ir_loop *ir) printf("(loop (\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->body_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->body_instructions) { + ir_instruction *const inst = (ir_instruction *) n; indent(); inst->accept(this); diff --git a/mesalib/src/glsl/ir_reader.cpp b/mesalib/src/glsl/ir_reader.cpp index 7970112ec..28923f3b8 100644 --- a/mesalib/src/glsl/ir_reader.cpp +++ b/mesalib/src/glsl/ir_reader.cpp @@ -170,8 +170,8 @@ ir_reader::scan_for_prototypes(exec_list *instructions, s_expression *expr) return; } - foreach_iter(exec_list_iterator, it, list->subexpressions) { - s_list *sub = SX_AS_LIST(it.get()); + foreach_list(n, &list->subexpressions) { + s_list *sub = SX_AS_LIST(n); if (sub == NULL) continue; // not a (function ...); ignore it. @@ -205,11 +205,12 @@ ir_reader::read_function(s_expression *expr, bool skip_body) assert(added); } - exec_list_iterator it = ((s_list *) expr)->subexpressions.iterator(); - it.next(); // skip "function" tag - it.next(); // skip function name - for (/* nothing */; it.has_next(); it.next()) { - s_expression *s_sig = (s_expression *) it.get(); + /* Skip over "function" tag and function name (which are guaranteed to be + * present by the above PARTIAL_MATCH call). + */ + exec_node *node = ((s_list *) expr)->subexpressions.head->next->next; + for (/* nothing */; !node->is_tail_sentinel(); node = node->next) { + s_expression *s_sig = (s_expression *) node; read_function_sig(f, s_sig, skip_body); } return added ? f : NULL; @@ -249,9 +250,10 @@ ir_reader::read_function_sig(ir_function *f, s_expression *expr, bool skip_body) exec_list hir_parameters; state->symbols->push_scope(); - exec_list_iterator it = paramlist->subexpressions.iterator(); - for (it.next() /* skip "parameters" */; it.has_next(); it.next()) { - ir_variable *var = read_declaration((s_expression *) it.get()); + /* Skip over the "parameters" tag. */ + exec_node *node = paramlist->subexpressions.head->next; + for (/* nothing */; !node->is_tail_sentinel(); node = node->next) { + ir_variable *var = read_declaration((s_expression *) node); if (var == NULL) return; @@ -315,8 +317,8 @@ ir_reader::read_instructions(exec_list *instructions, s_expression *expr, return; } - foreach_iter(exec_list_iterator, it, list->subexpressions) { - s_expression *sub = (s_expression*) it.get(); + foreach_list(n, &list->subexpressions) { + s_expression *sub = (s_expression *) n; ir_instruction *ir = read_instruction(sub, loop_ctx); if (ir != NULL) { /* Global variable declarations should be moved to the top, before @@ -403,8 +405,8 @@ ir_reader::read_declaration(s_expression *expr) ir_variable *var = new(mem_ctx) ir_variable(type, s_name->value(), ir_var_auto); - foreach_iter(exec_list_iterator, it, s_quals->subexpressions) { - s_symbol *qualifier = SX_AS_SYMBOL(it.get()); + foreach_list(n, &s_quals->subexpressions) { + s_symbol *qualifier = SX_AS_SYMBOL(n); if (qualifier == NULL) { ir_read_error(expr, "qualifier list must contain only symbols"); return NULL; @@ -656,8 +658,8 @@ ir_reader::read_call(s_expression *expr) exec_list parameters; - foreach_iter(exec_list_iterator, it, params->subexpressions) { - s_expression *expr = (s_expression*) it.get(); + foreach_list(n, ¶ms->subexpressions) { + s_expression *expr = (s_expression *) n; ir_rvalue *param = read_rvalue(expr); if (param == NULL) { ir_read_error(expr, "when reading parameter to function call"); @@ -796,8 +798,8 @@ ir_reader::read_constant(s_expression *expr) if (type->is_array()) { unsigned elements_supplied = 0; exec_list elements; - foreach_iter(exec_list_iterator, it, values->subexpressions) { - s_expression *elt = (s_expression *) it.get(); + foreach_list(n, &values->subexpressions) { + s_expression *elt = (s_expression *) n; ir_constant *ir_elt = read_constant(elt); if (ir_elt == NULL) return NULL; @@ -817,13 +819,13 @@ ir_reader::read_constant(s_expression *expr) // Read in list of values (at most 16). unsigned k = 0; - foreach_iter(exec_list_iterator, it, values->subexpressions) { + foreach_list(n, &values->subexpressions) { if (k >= 16) { ir_read_error(values, "expected at most 16 numbers"); return NULL; } - s_expression *expr = (s_expression*) it.get(); + s_expression *expr = (s_expression *) n; if (type->base_type == GLSL_TYPE_FLOAT) { s_number *value = SX_AS_NUMBER(expr); diff --git a/mesalib/src/glsl/ir_rvalue_visitor.cpp b/mesalib/src/glsl/ir_rvalue_visitor.cpp index 9d8ccd94a..fcbe9448d 100644 --- a/mesalib/src/glsl/ir_rvalue_visitor.cpp +++ b/mesalib/src/glsl/ir_rvalue_visitor.cpp @@ -123,8 +123,8 @@ ir_rvalue_base_visitor::rvalue_visit(ir_assignment *ir) ir_visitor_status ir_rvalue_base_visitor::rvalue_visit(ir_call *ir) { - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param = (ir_rvalue *)iter.get(); + foreach_list_safe(n, &ir->actual_parameters) { + ir_rvalue *param = (ir_rvalue *) n; ir_rvalue *new_param = param; handle_rvalue(&new_param); diff --git a/mesalib/src/glsl/ir_set_program_inouts.cpp b/mesalib/src/glsl/ir_set_program_inouts.cpp index 0b49eb2b6..5163eb215 100644 --- a/mesalib/src/glsl/ir_set_program_inouts.cpp +++ b/mesalib/src/glsl/ir_set_program_inouts.cpp @@ -46,10 +46,11 @@ namespace { class ir_set_program_inouts_visitor : public ir_hierarchical_visitor { public: - ir_set_program_inouts_visitor(struct gl_program *prog, GLenum shader_type) + ir_set_program_inouts_visitor(struct gl_program *prog, + gl_shader_stage shader_stage) { this->prog = prog; - this->shader_type = shader_type; + this->shader_stage = shader_stage; } ~ir_set_program_inouts_visitor() { @@ -67,7 +68,7 @@ private: bool try_mark_partial_variable(ir_variable *var, ir_rvalue *index); struct gl_program *prog; - GLenum shader_type; + gl_shader_stage shader_stage; }; } /* anonymous namespace */ @@ -124,13 +125,13 @@ void ir_set_program_inouts_visitor::mark_whole_variable(ir_variable *var) { const glsl_type *type = var->type; - if (this->shader_type == GL_GEOMETRY_SHADER && + if (this->shader_stage == MESA_SHADER_GEOMETRY && var->data.mode == ir_var_shader_in && type->is_array()) { type = type->fields.array; } mark(this->prog, var, 0, type->count_attribute_slots(), - this->shader_type == GL_FRAGMENT_SHADER); + this->shader_stage == MESA_SHADER_FRAGMENT); } /* Default handler: Mark all the locations in the variable as used. */ @@ -163,7 +164,7 @@ ir_set_program_inouts_visitor::try_mark_partial_variable(ir_variable *var, { const glsl_type *type = var->type; - if (this->shader_type == GL_GEOMETRY_SHADER && + if (this->shader_stage == MESA_SHADER_GEOMETRY && var->data.mode == ir_var_shader_in) { /* The only geometry shader input that is not an array is * gl_PrimitiveIDIn, and in that case, this code will never be reached, @@ -227,7 +228,7 @@ ir_set_program_inouts_visitor::try_mark_partial_variable(ir_variable *var, } mark(this->prog, var, index_as_constant->value.u[0] * elem_width, - elem_width, this->shader_type == GL_FRAGMENT_SHADER); + elem_width, this->shader_stage == MESA_SHADER_FRAGMENT); return true; } @@ -245,7 +246,7 @@ ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir) */ if (ir_dereference_variable * const deref_var = inner_array->array->as_dereference_variable()) { - if (this->shader_type == GL_GEOMETRY_SHADER && + if (this->shader_stage == MESA_SHADER_GEOMETRY && deref_var->var->data.mode == ir_var_shader_in) { /* foo is a geometry shader input, so i is the vertex, and j the * part of the input we're accessing. @@ -264,7 +265,7 @@ ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir) } else if (ir_dereference_variable * const deref_var = ir->array->as_dereference_variable()) { /* ir => foo[i], where foo is a variable. */ - if (this->shader_type == GL_GEOMETRY_SHADER && + if (this->shader_stage == MESA_SHADER_GEOMETRY && deref_var->var->data.mode == ir_var_shader_in) { /* foo is a geometry shader input, so i is the vertex, and we're * accessing the entire input. @@ -304,7 +305,7 @@ ir_set_program_inouts_visitor::visit_enter(ir_function_signature *ir) ir_visitor_status ir_set_program_inouts_visitor::visit_enter(ir_expression *ir) { - if (this->shader_type == GL_FRAGMENT_SHADER && + if (this->shader_stage == MESA_SHADER_FRAGMENT && ir->operation == ir_unop_dFdy) { gl_fragment_program *fprog = (gl_fragment_program *) prog; fprog->UsesDFdy = true; @@ -316,7 +317,7 @@ ir_visitor_status ir_set_program_inouts_visitor::visit_enter(ir_discard *) { /* discards are only allowed in fragment shaders. */ - assert(this->shader_type == GL_FRAGMENT_SHADER); + assert(this->shader_stage == MESA_SHADER_FRAGMENT); gl_fragment_program *fprog = (gl_fragment_program *) prog; fprog->UsesKill = true; @@ -334,14 +335,14 @@ ir_set_program_inouts_visitor::visit_enter(ir_texture *ir) void do_set_program_inouts(exec_list *instructions, struct gl_program *prog, - GLenum shader_type) + gl_shader_stage shader_stage) { - ir_set_program_inouts_visitor v(prog, shader_type); + ir_set_program_inouts_visitor v(prog, shader_stage); prog->InputsRead = 0; prog->OutputsWritten = 0; prog->SystemValuesRead = 0; - if (shader_type == GL_FRAGMENT_SHADER) { + if (shader_stage == MESA_SHADER_FRAGMENT) { gl_fragment_program *fprog = (gl_fragment_program *) prog; memset(fprog->InterpQualifier, 0, sizeof(fprog->InterpQualifier)); fprog->IsCentroid = 0; diff --git a/mesalib/src/glsl/ir_uniform.h b/mesalib/src/glsl/ir_uniform.h index 13faab7c0..f678c2c5c 100644 --- a/mesalib/src/glsl/ir_uniform.h +++ b/mesalib/src/glsl/ir_uniform.h @@ -116,7 +116,7 @@ struct gl_uniform_storage { * Whether this sampler is used in this shader stage. */ bool active; - } sampler[MESA_SHADER_TYPES]; + } sampler[MESA_SHADER_STAGES]; /** * Storage used by the driver for the uniform diff --git a/mesalib/src/glsl/ir_validate.cpp b/mesalib/src/glsl/ir_validate.cpp index 4bbb3ce65..527acea4c 100644 --- a/mesalib/src/glsl/ir_validate.cpp +++ b/mesalib/src/glsl/ir_validate.cpp @@ -813,8 +813,8 @@ validate_ir_tree(exec_list *instructions) v.run(instructions); - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; visit_tree(ir, check_node_type, NULL); } diff --git a/mesalib/src/glsl/link_atomics.cpp b/mesalib/src/glsl/link_atomics.cpp index 603329c50..db9c53965 100644 --- a/mesalib/src/glsl/link_atomics.cpp +++ b/mesalib/src/glsl/link_atomics.cpp @@ -64,7 +64,7 @@ namespace { active_atomic_counter *counters; unsigned num_counters; - unsigned stage_references[MESA_SHADER_TYPES]; + unsigned stage_references[MESA_SHADER_STAGES]; unsigned size; }; @@ -96,7 +96,7 @@ namespace { *num_buffers = 0; - for (unsigned i = 0; i < MESA_SHADER_TYPES; ++i) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; ++i) { struct gl_shader *sh = prog->_LinkedShaders[i]; if (sh == NULL) continue; @@ -199,7 +199,7 @@ link_assign_atomic_counter_resources(struct gl_context *ctx, } /* Assign stage-specific fields. */ - for (unsigned j = 0; j < MESA_SHADER_TYPES; ++j) + for (unsigned j = 0; j < MESA_SHADER_STAGES; ++j) mab.StageReferences[j] = (ab.stage_references[j] ? GL_TRUE : GL_FALSE); @@ -214,23 +214,11 @@ void link_check_atomic_counter_resources(struct gl_context *ctx, struct gl_shader_program *prog) { - const unsigned max_atomic_counters[] = { - ctx->Const.VertexProgram.MaxAtomicCounters, - ctx->Const.GeometryProgram.MaxAtomicCounters, - ctx->Const.FragmentProgram.MaxAtomicCounters - }; - STATIC_ASSERT(Elements(max_atomic_counters) == MESA_SHADER_TYPES); - const unsigned max_atomic_buffers[] = { - ctx->Const.VertexProgram.MaxAtomicBuffers, - ctx->Const.GeometryProgram.MaxAtomicBuffers, - ctx->Const.FragmentProgram.MaxAtomicBuffers - }; - STATIC_ASSERT(Elements(max_atomic_buffers) == MESA_SHADER_TYPES); unsigned num_buffers; active_atomic_buffer *const abs = find_active_atomic_counters(ctx, prog, &num_buffers); - unsigned atomic_counters[MESA_SHADER_TYPES] = {}; - unsigned atomic_buffers[MESA_SHADER_TYPES] = {}; + unsigned atomic_counters[MESA_SHADER_STAGES] = {}; + unsigned atomic_buffers[MESA_SHADER_STAGES] = {}; unsigned total_atomic_counters = 0; unsigned total_atomic_buffers = 0; @@ -243,7 +231,7 @@ link_check_atomic_counter_resources(struct gl_context *ctx, if (abs[i].size == 0) continue; - for (unsigned j = 0; j < MESA_SHADER_TYPES; ++j) { + for (unsigned j = 0; j < MESA_SHADER_STAGES; ++j) { const unsigned n = abs[i].stage_references[j]; if (n) { @@ -256,14 +244,14 @@ link_check_atomic_counter_resources(struct gl_context *ctx, } /* Check that they are within the supported limits. */ - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { - if (atomic_counters[i] > max_atomic_counters[i]) + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + if (atomic_counters[i] > ctx->Const.Program[i].MaxAtomicCounters) linker_error(prog, "Too many %s shader atomic counters", - _mesa_shader_type_to_string(i)); + _mesa_shader_stage_to_string(i)); - if (atomic_buffers[i] > max_atomic_buffers[i]) + if (atomic_buffers[i] > ctx->Const.Program[i].MaxAtomicBuffers) linker_error(prog, "Too many %s shader atomic counter buffers", - _mesa_shader_type_to_string(i)); + _mesa_shader_stage_to_string(i)); } if (total_atomic_counters > ctx->Const.MaxCombinedAtomicCounters) diff --git a/mesalib/src/glsl/link_interface_blocks.cpp b/mesalib/src/glsl/link_interface_blocks.cpp index 476963642..52552cc68 100644 --- a/mesalib/src/glsl/link_interface_blocks.cpp +++ b/mesalib/src/glsl/link_interface_blocks.cpp @@ -313,7 +313,7 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog, const gl_shader *consumer) { interface_block_definitions definitions; - const bool extra_array_level = consumer->Type == GL_GEOMETRY_SHADER; + const bool extra_array_level = consumer->Stage == MESA_SHADER_GEOMETRY; /* Add input interfaces from the consumer to the symbol table. */ foreach_list(node, consumer->ir) { diff --git a/mesalib/src/glsl/link_uniform_initializers.cpp b/mesalib/src/glsl/link_uniform_initializers.cpp index 04daa1760..7d5c1472d 100644 --- a/mesalib/src/glsl/link_uniform_initializers.cpp +++ b/mesalib/src/glsl/link_uniform_initializers.cpp @@ -106,7 +106,7 @@ set_uniform_binding(void *mem_ctx, gl_shader_program *prog, storage->storage[i].i = binding + i; } - for (int sh = 0; sh < MESA_SHADER_TYPES; sh++) { + for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) { gl_shader *shader = prog->_LinkedShaders[sh]; if (shader && storage->sampler[sh].active) { @@ -119,7 +119,7 @@ set_uniform_binding(void *mem_ctx, gl_shader_program *prog, } } else if (storage->block_index != -1) { /* This is a field of a UBO. val is the binding index. */ - for (int i = 0; i < MESA_SHADER_TYPES; i++) { + for (int i = 0; i < MESA_SHADER_STAGES; i++) { int stage_index = prog->UniformBlockStageIndex[i][storage->block_index]; if (stage_index != -1) { @@ -194,7 +194,7 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, val->type->components()); if (storage->type->is_sampler()) { - for (int sh = 0; sh < MESA_SHADER_TYPES; sh++) { + for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) { gl_shader *shader = prog->_LinkedShaders[sh]; if (shader && storage->sampler[sh].active) { @@ -215,7 +215,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog) { void *mem_ctx = NULL; - for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_shader *shader = prog->_LinkedShaders[i]; if (shader == NULL) diff --git a/mesalib/src/glsl/link_uniforms.cpp b/mesalib/src/glsl/link_uniforms.cpp index 1cbe80b2e..2255f7e6e 100644 --- a/mesalib/src/glsl/link_uniforms.cpp +++ b/mesalib/src/glsl/link_uniforms.cpp @@ -356,9 +356,9 @@ public: { } - void start_shader(gl_shader_type shader_type) + void start_shader(gl_shader_stage shader_type) { - assert(shader_type < MESA_SHADER_TYPES); + assert(shader_type < MESA_SHADER_STAGES); this->shader_type = shader_type; this->shader_samplers_used = 0; @@ -429,7 +429,7 @@ public: int ubo_block_index; int ubo_byte_offset; bool ubo_row_major; - gl_shader_type shader_type; + gl_shader_stage shader_type; private: void handle_samplers(const glsl_type *base_type, @@ -741,7 +741,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog) * glGetUniformLocation. */ count_uniform_size uniform_size(prog->UniformHash); - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_shader *sh = prog->_LinkedShaders[i]; if (sh == NULL) @@ -809,11 +809,11 @@ link_assign_uniform_locations(struct gl_shader_program *prog) parcel_out_uniform_storage parcel(prog->UniformHash, uniforms, data); - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; - parcel.start_shader((gl_shader_type)i); + parcel.start_shader((gl_shader_stage)i); foreach_list(node, prog->_LinkedShaders[i]->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); diff --git a/mesalib/src/glsl/link_varyings.cpp b/mesalib/src/glsl/link_varyings.cpp index 98f902ca4..c925c00e3 100644 --- a/mesalib/src/glsl/link_varyings.cpp +++ b/mesalib/src/glsl/link_varyings.cpp @@ -48,13 +48,13 @@ static void cross_validate_types_and_qualifiers(struct gl_shader_program *prog, const ir_variable *input, const ir_variable *output, - GLenum consumer_type, - GLenum producer_type) + gl_shader_stage consumer_stage, + gl_shader_stage producer_stage) { /* Check that the types match between stages. */ const glsl_type *type_to_match = input->type; - if (consumer_type == GL_GEOMETRY_SHADER) { + if (consumer_stage == MESA_SHADER_GEOMETRY) { assert(type_to_match->is_array()); /* Enforced by ast_to_hir */ type_to_match = type_to_match->element_type(); } @@ -82,10 +82,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, linker_error(prog, "%s shader output `%s' declared as type `%s', " "but %s shader input declared as type `%s'\n", - _mesa_shader_enum_to_string(producer_type), + _mesa_shader_stage_to_string(producer_stage), output->name, output->type->name, - _mesa_shader_enum_to_string(consumer_type), + _mesa_shader_stage_to_string(consumer_stage), input->type->name); return; } @@ -97,10 +97,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, linker_error(prog, "%s shader output `%s' %s centroid qualifier, " "but %s shader input %s centroid qualifier\n", - _mesa_shader_enum_to_string(producer_type), + _mesa_shader_stage_to_string(producer_stage), output->name, (output->data.centroid) ? "has" : "lacks", - _mesa_shader_enum_to_string(consumer_type), + _mesa_shader_stage_to_string(consumer_stage), (input->data.centroid) ? "has" : "lacks"); return; } @@ -109,10 +109,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, linker_error(prog, "%s shader output `%s' %s sample qualifier, " "but %s shader input %s sample qualifier\n", - _mesa_shader_enum_to_string(producer_type), + _mesa_shader_stage_to_string(producer_stage), output->name, (output->data.sample) ? "has" : "lacks", - _mesa_shader_enum_to_string(consumer_type), + _mesa_shader_stage_to_string(consumer_stage), (input->data.sample) ? "has" : "lacks"); return; } @@ -121,10 +121,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, linker_error(prog, "%s shader output `%s' %s invariant qualifier, " "but %s shader input %s invariant qualifier\n", - _mesa_shader_enum_to_string(producer_type), + _mesa_shader_stage_to_string(producer_stage), output->name, (output->data.invariant) ? "has" : "lacks", - _mesa_shader_enum_to_string(consumer_type), + _mesa_shader_stage_to_string(consumer_stage), (input->data.invariant) ? "has" : "lacks"); return; } @@ -135,10 +135,10 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, "interpolation qualifier, " "but %s shader input specifies %s " "interpolation qualifier\n", - _mesa_shader_enum_to_string(producer_type), + _mesa_shader_stage_to_string(producer_stage), output->name, interpolation_string(output->data.interpolation), - _mesa_shader_enum_to_string(consumer_type), + _mesa_shader_stage_to_string(consumer_stage), interpolation_string(input->data.interpolation)); return; } @@ -152,16 +152,16 @@ cross_validate_front_and_back_color(struct gl_shader_program *prog, const ir_variable *input, const ir_variable *front_color, const ir_variable *back_color, - GLenum consumer_type, - GLenum producer_type) + gl_shader_stage consumer_stage, + gl_shader_stage producer_stage) { if (front_color != NULL && front_color->data.assigned) cross_validate_types_and_qualifiers(prog, input, front_color, - consumer_type, producer_type); + consumer_stage, producer_stage); if (back_color != NULL && back_color->data.assigned) cross_validate_types_and_qualifiers(prog, input, back_color, - consumer_type, producer_type); + consumer_stage, producer_stage); } /** @@ -208,7 +208,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, cross_validate_front_and_back_color(prog, input, front_color, back_color, - consumer->Type, producer->Type); + consumer->Stage, producer->Stage); } else if (strcmp(input->name, "gl_SecondaryColor") == 0 && input->data.used) { const ir_variable *const front_color = parameters.get_variable("gl_FrontSecondaryColor"); @@ -218,12 +218,12 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, cross_validate_front_and_back_color(prog, input, front_color, back_color, - consumer->Type, producer->Type); + consumer->Stage, producer->Stage); } else { ir_variable *const output = parameters.get_variable(input->name); if (output != NULL) { cross_validate_types_and_qualifiers(prog, input, output, - consumer->Type, producer->Type); + consumer->Stage, producer->Stage); } } } @@ -943,10 +943,10 @@ varying_matches::match_comparator(const void *x_generic, const void *y_generic) * varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord. */ static bool -is_varying_var(GLenum shaderType, const ir_variable *var) +is_varying_var(gl_shader_stage stage, const ir_variable *var) { /* Only fragment shaders will take a varying variable as an input */ - if (shaderType == GL_FRAGMENT_SHADER && + if (stage == MESA_SHADER_FRAGMENT && var->data.mode == ir_var_shader_in) { switch (var->data.location) { case VARYING_SLOT_POS: @@ -1072,7 +1072,7 @@ assign_varying_locations(struct gl_context *ctx, const unsigned producer_base = VARYING_SLOT_VAR0; const unsigned consumer_base = VARYING_SLOT_VAR0; varying_matches matches(ctx->Const.DisableVaryingPacking, - consumer && consumer->Type == GL_FRAGMENT_SHADER); + consumer && consumer->Stage == MESA_SHADER_FRAGMENT); hash_table *tfeedback_candidates = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare); hash_table *consumer_inputs @@ -1217,9 +1217,9 @@ assign_varying_locations(struct gl_context *ctx, linker_error(prog, "%s shader varying %s not written " "by %s shader\n.", - _mesa_shader_enum_to_string(consumer->Type), + _mesa_shader_stage_to_string(consumer->Stage), var->name, - _mesa_shader_enum_to_string(producer->Type)); + _mesa_shader_stage_to_string(producer->Stage)); } /* An 'in' variable is only really a shader input if its @@ -1244,24 +1244,14 @@ check_against_output_limit(struct gl_context *ctx, ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var && var->data.mode == ir_var_shader_out && - is_varying_var(producer->Type, var)) { + is_varying_var(producer->Stage, var)) { output_vectors += var->type->count_attribute_slots(); } } - unsigned max_output_components; - switch (producer->Type) { - case GL_VERTEX_SHADER: - max_output_components = ctx->Const.VertexProgram.MaxOutputComponents; - break; - case GL_GEOMETRY_SHADER: - max_output_components = ctx->Const.GeometryProgram.MaxOutputComponents; - break; - case GL_FRAGMENT_SHADER: - default: - assert(!"Should not get here."); - return false; - } + assert(producer->Stage != MESA_SHADER_FRAGMENT); + unsigned max_output_components = + ctx->Const.Program[producer->Stage].MaxOutputComponents; const unsigned output_components = output_vectors * 4; if (output_components > max_output_components) { @@ -1293,24 +1283,14 @@ check_against_input_limit(struct gl_context *ctx, ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var && var->data.mode == ir_var_shader_in && - is_varying_var(consumer->Type, var)) { + is_varying_var(consumer->Stage, var)) { input_vectors += var->type->count_attribute_slots(); } } - unsigned max_input_components; - switch (consumer->Type) { - case GL_GEOMETRY_SHADER: - max_input_components = ctx->Const.GeometryProgram.MaxInputComponents; - break; - case GL_FRAGMENT_SHADER: - max_input_components = ctx->Const.FragmentProgram.MaxInputComponents; - break; - case GL_VERTEX_SHADER: - default: - assert(!"Should not get here."); - return false; - } + assert(consumer->Stage != MESA_SHADER_VERTEX); + unsigned max_input_components = + ctx->Const.Program[consumer->Stage].MaxInputComponents; const unsigned input_components = input_vectors * 4; if (input_components > max_input_components) { diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp index a81e10737..85a4d3883 100644 --- a/mesalib/src/glsl/linker.cpp +++ b/mesalib/src/glsl/linker.cpp @@ -109,10 +109,10 @@ public: virtual ir_visitor_status visit_enter(ir_call *ir) { - exec_list_iterator sig_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param_rval = (ir_rvalue *)iter.get(); - ir_variable *sig_param = (ir_variable *)sig_iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_rvalue *param_rval = (ir_rvalue *) actual_node; + ir_variable *sig_param = (ir_variable *) formal_node; if (sig_param->data.mode == ir_var_function_out || sig_param->data.mode == ir_var_function_inout) { @@ -122,7 +122,6 @@ public: return visit_stop; } } - sig_iter.next(); } if (ir->return_deref != NULL) { @@ -438,7 +437,7 @@ analyze_clip_usage(struct gl_shader_program *prog, if (clip_vertex.variable_found() && clip_distance.variable_found()) { linker_error(prog, "%s shader writes to both `gl_ClipVertex' " "and `gl_ClipDistance'\n", - _mesa_shader_enum_to_string(shader->Type)); + _mesa_shader_stage_to_string(shader->Stage)); return; } *UsesClipDistance = clip_distance.variable_found(); @@ -786,7 +785,7 @@ void cross_validate_uniforms(struct gl_shader_program *prog) { cross_validate_globals(prog, prog->_LinkedShaders, - MESA_SHADER_TYPES, true); + MESA_SHADER_STAGES, true); } /** @@ -797,12 +796,12 @@ static bool interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog) { unsigned max_num_uniform_blocks = 0; - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i]) max_num_uniform_blocks += prog->_LinkedShaders[i]->NumUniformBlocks; } - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_shader *sh = prog->_LinkedShaders[i]; prog->UniformBlockStageIndex[i] = ralloc_array(prog, int, @@ -1209,7 +1208,7 @@ link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, /* No in/out qualifiers defined for anything but GLSL 1.50+ * geometry shaders so far. */ - if (linked_shader->Type != GL_GEOMETRY_SHADER || prog->Version < 150) + if (linked_shader->Stage != MESA_SHADER_GEOMETRY || prog->Version < 150) return; /* From the GLSL 1.50 spec, page 46: @@ -1338,9 +1337,8 @@ link_intrastage_shaders(void *mem_ctx, if (other == NULL) continue; - foreach_iter (exec_list_iterator, iter, *f) { - ir_function_signature *sig = - (ir_function_signature *) iter.get(); + foreach_list(n, &f->signatures) { + ir_function_signature *sig = (ir_function_signature *) n; if (!sig->is_defined || sig->is_builtin()) continue; @@ -1376,7 +1374,7 @@ link_intrastage_shaders(void *mem_ctx, if (main == NULL) { linker_error(prog, "%s shader lacks `main'\n", - _mesa_shader_enum_to_string(shader_list[0]->Type)); + _mesa_shader_stage_to_string(shader_list[0]->Stage)); return NULL; } @@ -1450,11 +1448,11 @@ link_intrastage_shaders(void *mem_ctx, validate_ir_tree(linked->ir); /* Set the size of geometry shader input arrays */ - if (linked->Type == GL_GEOMETRY_SHADER) { + if (linked->Stage == MESA_SHADER_GEOMETRY) { unsigned num_vertices = vertices_per_prim(prog->Geom.InputType); geom_array_resize_visitor input_resize_visitor(num_vertices, prog); - foreach_iter(exec_list_iterator, iter, *linked->ir) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, linked->ir) { + ir_instruction *ir = (ir_instruction *) n; ir->accept(&input_resize_visitor); } } @@ -1488,7 +1486,7 @@ link_intrastage_shaders(void *mem_ctx, static void update_array_sizes(struct gl_shader_program *prog) { - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; @@ -1511,7 +1509,7 @@ update_array_sizes(struct gl_shader_program *prog) continue; unsigned int size = var->data.max_array_access; - for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) { + for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) { if (prog->_LinkedShaders[j] == NULL) continue; @@ -1894,80 +1892,51 @@ store_fragdepth_layout(struct gl_shader_program *prog) static void check_resources(struct gl_context *ctx, struct gl_shader_program *prog) { - const unsigned max_samplers[] = { - ctx->Const.VertexProgram.MaxTextureImageUnits, - ctx->Const.GeometryProgram.MaxTextureImageUnits, - ctx->Const.FragmentProgram.MaxTextureImageUnits - }; - STATIC_ASSERT(Elements(max_samplers) == MESA_SHADER_TYPES); - - const unsigned max_default_uniform_components[] = { - ctx->Const.VertexProgram.MaxUniformComponents, - ctx->Const.GeometryProgram.MaxUniformComponents, - ctx->Const.FragmentProgram.MaxUniformComponents - }; - STATIC_ASSERT(Elements(max_default_uniform_components) == - MESA_SHADER_TYPES); - - const unsigned max_combined_uniform_components[] = { - ctx->Const.VertexProgram.MaxCombinedUniformComponents, - ctx->Const.GeometryProgram.MaxCombinedUniformComponents, - ctx->Const.FragmentProgram.MaxCombinedUniformComponents - }; - STATIC_ASSERT(Elements(max_combined_uniform_components) == - MESA_SHADER_TYPES); - - const unsigned max_uniform_blocks[] = { - ctx->Const.VertexProgram.MaxUniformBlocks, - ctx->Const.GeometryProgram.MaxUniformBlocks, - ctx->Const.FragmentProgram.MaxUniformBlocks - }; - STATIC_ASSERT(Elements(max_uniform_blocks) == MESA_SHADER_TYPES); - - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_shader *sh = prog->_LinkedShaders[i]; if (sh == NULL) continue; - if (sh->num_samplers > max_samplers[i]) { + if (sh->num_samplers > ctx->Const.Program[i].MaxTextureImageUnits) { linker_error(prog, "Too many %s shader texture samplers", - _mesa_shader_type_to_string(i)); + _mesa_shader_stage_to_string(i)); } - if (sh->num_uniform_components > max_default_uniform_components[i]) { + if (sh->num_uniform_components > + ctx->Const.Program[i].MaxUniformComponents) { if (ctx->Const.GLSLSkipStrictMaxUniformLimitCheck) { linker_warning(prog, "Too many %s shader default uniform block " "components, but the driver will try to optimize " "them out; this is non-portable out-of-spec " "behavior\n", - _mesa_shader_type_to_string(i)); + _mesa_shader_stage_to_string(i)); } else { linker_error(prog, "Too many %s shader default uniform block " "components", - _mesa_shader_type_to_string(i)); + _mesa_shader_stage_to_string(i)); } } if (sh->num_combined_uniform_components > - max_combined_uniform_components[i]) { + ctx->Const.Program[i].MaxCombinedUniformComponents) { if (ctx->Const.GLSLSkipStrictMaxUniformLimitCheck) { linker_warning(prog, "Too many %s shader uniform components, " "but the driver will try to optimize them out; " "this is non-portable out-of-spec behavior\n", - _mesa_shader_type_to_string(i)); + _mesa_shader_stage_to_string(i)); } else { linker_error(prog, "Too many %s shader uniform components", - _mesa_shader_type_to_string(i)); + _mesa_shader_stage_to_string(i)); } } } - unsigned blocks[MESA_SHADER_TYPES] = {0}; + unsigned blocks[MESA_SHADER_STAGES] = {0}; unsigned total_uniform_blocks = 0; for (unsigned i = 0; i < prog->NumUniformBlocks; i++) { - for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) { + for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) { if (prog->UniformBlockStageIndex[j][i] != -1) { blocks[j]++; total_uniform_blocks++; @@ -1979,12 +1948,14 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog) prog->NumUniformBlocks, ctx->Const.MaxCombinedUniformBlocks); } else { - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { - if (blocks[i] > max_uniform_blocks[i]) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + const unsigned max_uniform_blocks = + ctx->Const.Program[i].MaxUniformBlocks; + if (blocks[i] > max_uniform_blocks) { linker_error(prog, "Too many %s uniform blocks (%d/%d)", - _mesa_shader_type_to_string(i), + _mesa_shader_stage_to_string(i), blocks[i], - max_uniform_blocks[i]); + max_uniform_blocks); break; } } @@ -2010,7 +1981,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) ralloc_free(prog->UniformBlocks); prog->UniformBlocks = NULL; prog->NumUniformBlocks = 0; - for (int i = 0; i < MESA_SHADER_TYPES; i++) { + for (int i = 0; i < MESA_SHADER_STAGES; i++) { ralloc_free(prog->UniformBlockStageIndex[i]); prog->UniformBlockStageIndex[i] = NULL; } @@ -2049,16 +2020,16 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; } - switch (prog->Shaders[i]->Type) { - case GL_VERTEX_SHADER: + switch (prog->Shaders[i]->Stage) { + case MESA_SHADER_VERTEX: vert_shader_list[num_vert_shaders] = prog->Shaders[i]; num_vert_shaders++; break; - case GL_FRAGMENT_SHADER: + case MESA_SHADER_FRAGMENT: frag_shader_list[num_frag_shaders] = prog->Shaders[i]; num_frag_shaders++; break; - case GL_GEOMETRY_SHADER: + case MESA_SHADER_GEOMETRY: geom_shader_list[num_geom_shaders] = prog->Shaders[i]; num_geom_shaders++; break; @@ -2085,7 +2056,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; } - for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] != NULL) ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]); @@ -2154,7 +2125,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) unsigned prev; - for (prev = 0; prev < MESA_SHADER_TYPES; prev++) { + for (prev = 0; prev < MESA_SHADER_STAGES; prev++) { if (prog->_LinkedShaders[prev] != NULL) break; } @@ -2162,7 +2133,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) /* Validate the inputs of each stage with the output of the preceding * stage. */ - for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = prev + 1; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; @@ -2182,11 +2153,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) /* Cross-validate uniform blocks between shader stages */ validate_interstage_uniform_blocks(prog, prog->_LinkedShaders, - MESA_SHADER_TYPES); + MESA_SHADER_STAGES); if (!prog->LinkStatus) goto done; - for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] != NULL) lower_named_interface_blocks(mem_ctx, prog->_LinkedShaders[i]); } @@ -2211,7 +2182,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) * uniforms, and varyings. Later optimization could possibly make * some of that unused. */ - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; @@ -2257,7 +2228,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) } unsigned first; - for (first = 0; first < MESA_SHADER_TYPES; first++) { + for (first = 0; first < MESA_SHADER_STAGES; first++) { if (prog->_LinkedShaders[first] != NULL) break; } @@ -2289,7 +2260,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) * eliminated if they are (transitively) not used in a later stage. */ int last, next; - for (last = MESA_SHADER_TYPES-1; last >= 0; last--) { + for (last = MESA_SHADER_STAGES-1; last >= 0; last--) { if (prog->_LinkedShaders[last] != NULL) break; } @@ -2404,7 +2375,7 @@ done: free(frag_shader_list); free(geom_shader_list); - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; diff --git a/mesalib/src/glsl/list.h b/mesalib/src/glsl/list.h index 2934539fe..b2e249657 100644 --- a/mesalib/src/glsl/list.h +++ b/mesalib/src/glsl/list.h @@ -210,62 +210,8 @@ struct exec_node { #ifdef __cplusplus struct exec_node; - -class iterator { -public: - void next() - { - } - - void *get() - { - return NULL; - } - - bool has_next() const - { - return false; - } -}; - -class exec_list_iterator : public iterator { -public: - exec_list_iterator(exec_node *n) : node(n), _next(n->next) - { - /* empty */ - } - - void next() - { - node = _next; - _next = node->next; - } - - void remove() - { - node->remove(); - } - - exec_node *get() - { - return node; - } - - bool has_next() const - { - return _next != NULL; - } - -private: - exec_node *node; - exec_node *_next; -}; - -#define foreach_iter(iter_type, iter, container) \ - for (iter_type iter = (container) . iterator(); iter.has_next(); iter.next()) #endif - struct exec_list { struct exec_node *head; struct exec_node *tail; @@ -412,16 +358,6 @@ struct exec_list { */ source->make_empty(); } - - exec_list_iterator iterator() - { - return exec_list_iterator(head); - } - - exec_list_iterator iterator() const - { - return exec_list_iterator((exec_node *) head); - } #endif }; @@ -455,6 +391,22 @@ inline void exec_node::insert_before(exec_list *before) ; (__node)->next != NULL \ ; (__node) = (__node)->next) +/** + * Iterate through two lists at once. Stops at the end of the shorter list. + * + * This is safe against either current node being removed or replaced. + */ +#define foreach_two_lists(__node1, __list1, __node2, __list2) \ + for (exec_node * __node1 = (__list1)->head, \ + * __node2 = (__list2)->head, \ + * __next1 = __node1->next, \ + * __next2 = __node2->next \ + ; __next1 != NULL && __next2 != NULL \ + ; __node1 = __next1, \ + __node2 = __next2, \ + __next1 = __next1->next, \ + __next2 = __next2->next) + #define foreach_list_const(__node, __list) \ for (const exec_node * __node = (__list)->head \ ; (__node)->next != NULL \ diff --git a/mesalib/src/glsl/lower_clip_distance.cpp b/mesalib/src/glsl/lower_clip_distance.cpp index bb4f6ab11..2d6138d5a 100644 --- a/mesalib/src/glsl/lower_clip_distance.cpp +++ b/mesalib/src/glsl/lower_clip_distance.cpp @@ -54,10 +54,10 @@ namespace { class lower_clip_distance_visitor : public ir_rvalue_visitor { public: - explicit lower_clip_distance_visitor(GLenum shader_type) + explicit lower_clip_distance_visitor(gl_shader_stage shader_stage) : progress(false), old_clip_distance_1d_var(NULL), old_clip_distance_2d_var(NULL), new_clip_distance_1d_var(NULL), - new_clip_distance_2d_var(NULL), shader_type(shader_type) + new_clip_distance_2d_var(NULL), shader_stage(shader_stage) { } @@ -96,9 +96,9 @@ public: ir_variable *new_clip_distance_2d_var; /** - * Type of shader we are compiling (e.g. GL_VERTEX_SHADER) + * Type of shader we are compiling (e.g. MESA_SHADER_VERTEX) */ - const GLenum shader_type; + const gl_shader_stage shader_stage; }; } /* anonymous namespace */ @@ -142,7 +142,7 @@ lower_clip_distance_visitor::visit(ir_variable *ir) } else { /* 2D gl_ClipDistance (used for geometry input). */ assert(ir->data.mode == ir_var_shader_in && - this->shader_type == GL_GEOMETRY_SHADER_ARB); + this->shader_stage == MESA_SHADER_GEOMETRY); if (this->old_clip_distance_2d_var) return visit_continue; @@ -253,7 +253,7 @@ lower_clip_distance_visitor::is_clip_distance_vec8(ir_rvalue *ir) } if (this->old_clip_distance_2d_var) { /* 2D clip distance is only possible as a geometry input */ - assert(this->shader_type == GL_GEOMETRY_SHADER_ARB); + assert(this->shader_stage == MESA_SHADER_GEOMETRY); ir_dereference_array *array_ref = ir->as_dereference_array(); if (array_ref) { @@ -288,7 +288,7 @@ lower_clip_distance_visitor::lower_clip_distance_vec8(ir_rvalue *ir) } if (this->old_clip_distance_2d_var) { /* 2D clip distance is only possible as a geometry input */ - assert(this->shader_type == GL_GEOMETRY_SHADER_ARB); + assert(this->shader_stage == MESA_SHADER_GEOMETRY); ir_dereference_array *array_ref = ir->as_dereference_array(); if (array_ref) { @@ -536,7 +536,7 @@ lower_clip_distance_visitor::visit_leave(ir_call *ir) bool lower_clip_distance(gl_shader *shader) { - lower_clip_distance_visitor v(shader->Type); + lower_clip_distance_visitor v(shader->Stage); visit_list_elements(&v, shader->ir); diff --git a/mesalib/src/glsl/lower_if_to_cond_assign.cpp b/mesalib/src/glsl/lower_if_to_cond_assign.cpp index 1e7ce51c7..f15b217e0 100644 --- a/mesalib/src/glsl/lower_if_to_cond_assign.cpp +++ b/mesalib/src/glsl/lower_if_to_cond_assign.cpp @@ -178,12 +178,12 @@ ir_if_to_cond_assign_visitor::visit_leave(ir_if *ir) ir_assignment *assign; /* Check that both blocks don't contain anything we can't support. */ - foreach_iter(exec_list_iterator, then_iter, ir->then_instructions) { - ir_instruction *then_ir = (ir_instruction *)then_iter.get(); + foreach_list(n, &ir->then_instructions) { + ir_instruction *then_ir = (ir_instruction *) n; visit_tree(then_ir, check_control_flow, &found_control_flow); } - foreach_iter(exec_list_iterator, else_iter, ir->else_instructions) { - ir_instruction *else_ir = (ir_instruction *)else_iter.get(); + foreach_list(n, &ir->else_instructions) { + ir_instruction *else_ir = (ir_instruction *) n; visit_tree(else_ir, check_control_flow, &found_control_flow); } if (found_control_flow) diff --git a/mesalib/src/glsl/lower_packed_varyings.cpp b/mesalib/src/glsl/lower_packed_varyings.cpp index 9edef5d04..c23d1801b 100644 --- a/mesalib/src/glsl/lower_packed_varyings.cpp +++ b/mesalib/src/glsl/lower_packed_varyings.cpp @@ -669,7 +669,7 @@ lower_packed_varyings(void *mem_ctx, unsigned location_base, gs_input_vertices, &new_instructions); visitor.run(instructions); if (mode == ir_var_shader_out) { - if (shader->Type == GL_GEOMETRY_SHADER) { + if (shader->Stage == MESA_SHADER_GEOMETRY) { /* For geometry shaders, outputs need to be lowered before each call * to EmitVertex() */ diff --git a/mesalib/src/glsl/lower_vec_index_to_cond_assign.cpp b/mesalib/src/glsl/lower_vec_index_to_cond_assign.cpp index 8080006c1..fe6a3f208 100644 --- a/mesalib/src/glsl/lower_vec_index_to_cond_assign.cpp +++ b/mesalib/src/glsl/lower_vec_index_to_cond_assign.cpp @@ -197,8 +197,8 @@ ir_vec_index_to_cond_assign_visitor::visit_leave(ir_assignment *ir) ir_visitor_status ir_vec_index_to_cond_assign_visitor::visit_enter(ir_call *ir) { - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param = (ir_rvalue *)iter.get(); + foreach_list_safe(n, &ir->actual_parameters) { + ir_rvalue *param = (ir_rvalue *) n; ir_rvalue *new_param = convert_vector_extract_to_cond_assign(param); if (new_param != param) { diff --git a/mesalib/src/glsl/lower_vec_index_to_swizzle.cpp b/mesalib/src/glsl/lower_vec_index_to_swizzle.cpp index 46985791e..b5bb00c30 100644 --- a/mesalib/src/glsl/lower_vec_index_to_swizzle.cpp +++ b/mesalib/src/glsl/lower_vec_index_to_swizzle.cpp @@ -131,8 +131,8 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_assignment *ir) ir_visitor_status ir_vec_index_to_swizzle_visitor::visit_enter(ir_call *ir) { - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param = (ir_rvalue *)iter.get(); + foreach_list_safe(n, &ir->actual_parameters) { + ir_rvalue *param = (ir_rvalue *) n; ir_rvalue *new_param = convert_vector_extract_to_swizzle(param); if (new_param != param) { diff --git a/mesalib/src/glsl/main.cpp b/mesalib/src/glsl/main.cpp index 4a5570608..56c32e688 100644 --- a/mesalib/src/glsl/main.cpp +++ b/mesalib/src/glsl/main.cpp @@ -73,20 +73,20 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 0; ctx->Const.MaxTextureUnits = 8; - ctx->Const.VertexProgram.MaxAttribs = 8; - ctx->Const.VertexProgram.MaxTextureImageUnits = 0; - ctx->Const.VertexProgram.MaxUniformComponents = 128 * 4; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 32; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 8; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 128 * 4; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32; - ctx->Const.FragmentProgram.MaxTextureImageUnits = + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits; - ctx->Const.FragmentProgram.MaxUniformComponents = 16 * 4; - ctx->Const.FragmentProgram.MaxInputComponents = - ctx->Const.VertexProgram.MaxOutputComponents; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 16 * 4; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ - ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4; + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; break; case 110: case 120: @@ -99,20 +99,20 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 2; ctx->Const.MaxTextureUnits = 2; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxTextureImageUnits = 0; - ctx->Const.VertexProgram.MaxUniformComponents = 512; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 32; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32; - ctx->Const.FragmentProgram.MaxTextureImageUnits = + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits; - ctx->Const.FragmentProgram.MaxUniformComponents = 64; - ctx->Const.FragmentProgram.MaxInputComponents = - ctx->Const.VertexProgram.MaxOutputComponents; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ - ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4; + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; break; case 130: case 140: @@ -125,19 +125,19 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 8; ctx->Const.MaxTextureUnits = 2; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxTextureImageUnits = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 1024; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 64; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64; - ctx->Const.FragmentProgram.MaxTextureImageUnits = 16; - ctx->Const.FragmentProgram.MaxUniformComponents = 1024; - ctx->Const.FragmentProgram.MaxInputComponents = - ctx->Const.VertexProgram.MaxOutputComponents; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ - ctx->Const.MaxVarying = ctx->Const.VertexProgram.MaxOutputComponents / 4; + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; break; case 150: case 330: @@ -149,28 +149,28 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 8; ctx->Const.MaxTextureUnits = 2; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxTextureImageUnits = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 1024; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 64; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64; - ctx->Const.GeometryProgram.MaxTextureImageUnits = 16; - ctx->Const.GeometryProgram.MaxUniformComponents = 1024; - ctx->Const.GeometryProgram.MaxInputComponents = - ctx->Const.VertexProgram.MaxOutputComponents; - ctx->Const.GeometryProgram.MaxOutputComponents = 128; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = 128; - ctx->Const.FragmentProgram.MaxTextureImageUnits = 16; - ctx->Const.FragmentProgram.MaxUniformComponents = 1024; - ctx->Const.FragmentProgram.MaxInputComponents = - ctx->Const.GeometryProgram.MaxOutputComponents; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ ctx->Const.MaxCombinedTextureImageUnits = - ctx->Const.VertexProgram.MaxTextureImageUnits - + ctx->Const.GeometryProgram.MaxTextureImageUnits - + ctx->Const.FragmentProgram.MaxTextureImageUnits; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits + + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits + + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; ctx->Const.MaxGeometryOutputVertices = 256; ctx->Const.MaxGeometryTotalOutputComponents = 1024; @@ -189,18 +189,18 @@ initialize_context(struct gl_context *ctx, gl_api api) ctx->Const.MaxTextureCoordUnits = 0; ctx->Const.MaxTextureUnits = 0; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxTextureImageUnits = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 1024; - ctx->Const.VertexProgram.MaxInputComponents = 0; /* not used */ - ctx->Const.VertexProgram.MaxOutputComponents = 16 * 4; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 16 * 4; - ctx->Const.FragmentProgram.MaxTextureImageUnits = 16; - ctx->Const.FragmentProgram.MaxUniformComponents = 224; - ctx->Const.FragmentProgram.MaxInputComponents = 15 * 4; - ctx->Const.FragmentProgram.MaxOutputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 224; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 15 * 4; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ - ctx->Const.MaxVarying = ctx->Const.FragmentProgram.MaxInputComponents / 4; + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4; break; } @@ -287,7 +287,7 @@ void compile_shader(struct gl_context *ctx, struct gl_shader *shader) { struct _mesa_glsl_parse_state *state = - new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader); + new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader); _mesa_glsl_compile_shader(ctx, shader, dump_ast, dump_hir); @@ -373,6 +373,7 @@ main(int argc, char **argv) shader->Type = GL_FRAGMENT_SHADER; else usage_fail(argv[0]); + shader->Stage = _mesa_shader_enum_to_shader_stage(shader->Type); shader->Source = load_text_file(whole_program, argv[optind]); if (shader->Source == NULL) { @@ -399,7 +400,7 @@ main(int argc, char **argv) printf("Info log for linking:\n%s\n", whole_program->InfoLog); } - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) ralloc_free(whole_program->_LinkedShaders[i]); ralloc_free(whole_program); diff --git a/mesalib/src/glsl/opt_algebraic.cpp b/mesalib/src/glsl/opt_algebraic.cpp index 05a589989..332f0b77b 100644 --- a/mesalib/src/glsl/opt_algebraic.cpp +++ b/mesalib/src/glsl/opt_algebraic.cpp @@ -88,6 +88,12 @@ is_vec_one(ir_constant *ir) } static inline bool +is_vec_two(ir_constant *ir) +{ + return (ir == NULL) ? false : ir->is_value(2.0, 2); +} + +static inline bool is_vec_negative_one(ir_constant *ir) { return (ir == NULL) ? false : ir->is_negative_one(); @@ -416,6 +422,17 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) } break; + case ir_binop_pow: + /* 1^x == 1 */ + if (is_vec_one(op_const[0])) + return op_const[0]; + + /* pow(2,x) == exp2(x) */ + if (is_vec_two(op_const[0])) + return expr(ir_unop_exp2, ir->operands[1]); + + break; + case ir_unop_rcp: if (op_expr[0] && op_expr[0]->operation == ir_unop_rcp) return op_expr[0]->operands[0]; diff --git a/mesalib/src/glsl/opt_array_splitting.cpp b/mesalib/src/glsl/opt_array_splitting.cpp index e946e0ae5..f37d09022 100644 --- a/mesalib/src/glsl/opt_array_splitting.cpp +++ b/mesalib/src/glsl/opt_array_splitting.cpp @@ -135,8 +135,8 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var) if (var->type->is_unsized_array()) return NULL; - foreach_iter(exec_list_iterator, iter, this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, &this->variable_list) { + variable_entry *entry = (variable_entry *) n; if (entry->var == var) return entry; } @@ -224,8 +224,8 @@ ir_array_reference_visitor::get_split_list(exec_list *instructions, } /* Trim out variables we found that we can't split. */ - foreach_iter(exec_list_iterator, iter, variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list_safe(n, &variable_list) { + variable_entry *entry = (variable_entry *) n; if (debug) { printf("array %s@%p: decl %d, split %d\n", @@ -270,8 +270,8 @@ ir_array_splitting_visitor::get_splitting_entry(ir_variable *var) { assert(var); - foreach_iter(exec_list_iterator, iter, *this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, this->variable_list) { + variable_entry *entry = (variable_entry *) n; if (entry->var == var) { return entry; } @@ -368,8 +368,8 @@ optimize_split_arrays(exec_list *instructions, bool linked) /* Replace the decls of the arrays to be split with their split * components. */ - foreach_iter(exec_list_iterator, iter, refs.variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, &refs.variable_list) { + variable_entry *entry = (variable_entry *) n; const struct glsl_type *type = entry->var->type; const struct glsl_type *subtype; diff --git a/mesalib/src/glsl/opt_constant_folding.cpp b/mesalib/src/glsl/opt_constant_folding.cpp index 08a47b96b..d0e575460 100644 --- a/mesalib/src/glsl/opt_constant_folding.cpp +++ b/mesalib/src/glsl/opt_constant_folding.cpp @@ -122,10 +122,10 @@ ir_visitor_status ir_constant_folding_visitor::visit_enter(ir_call *ir) { /* Attempt to constant fold parameters */ - exec_list_iterator sig_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param_rval = (ir_rvalue *)iter.get(); - ir_variable *sig_param = (ir_variable *)sig_iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_rvalue *param_rval = (ir_rvalue *) actual_node; + ir_variable *sig_param = (ir_variable *) formal_node; if (sig_param->data.mode == ir_var_function_in || sig_param->data.mode == ir_var_const_in) { @@ -136,7 +136,6 @@ ir_constant_folding_visitor::visit_enter(ir_call *ir) param_rval->replace_with(new_param); } } - sig_iter.next(); } /* Next, see if the call can be replaced with an assignment of a constant */ diff --git a/mesalib/src/glsl/opt_constant_propagation.cpp b/mesalib/src/glsl/opt_constant_propagation.cpp index f1a6fbdaa..18f5da689 100644 --- a/mesalib/src/glsl/opt_constant_propagation.cpp +++ b/mesalib/src/glsl/opt_constant_propagation.cpp @@ -172,8 +172,8 @@ ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue) channel = i; } - foreach_iter(exec_list_iterator, iter, *this->acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list(n, this->acp) { + acp_entry *entry = (acp_entry *) n; if (entry->var == deref->var && entry->write_mask & (1 << channel)) { found = entry; break; @@ -281,10 +281,10 @@ ir_visitor_status ir_constant_propagation_visitor::visit_enter(ir_call *ir) { /* Do constant propagation on call parameters, but skip any out params */ - exec_list_iterator sig_param_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { - ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); - ir_rvalue *param = (ir_rvalue *)iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *param = (ir_rvalue *) actual_node; if (sig_param->data.mode != ir_var_function_out && sig_param->data.mode != ir_var_function_inout) { ir_rvalue *new_param = param; @@ -294,7 +294,6 @@ ir_constant_propagation_visitor::visit_enter(ir_call *ir) else param->accept(this); } - sig_param_iter.next(); } /* Since we're unlinked, we don't (necssarily) know the side effects of @@ -318,8 +317,8 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a constant of the original */ - foreach_iter(exec_list_iterator, iter, *orig_acp) { - acp_entry *a = (acp_entry *)iter.get(); + foreach_list(n, orig_acp) { + acp_entry *a = (acp_entry *) n; this->acp->push_tail(new(this->mem_ctx) acp_entry(a)); } @@ -334,8 +333,8 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_iter(exec_list_iterator, iter, *new_kills) { - kill_entry *k = (kill_entry *)iter.get(); + foreach_list(n, new_kills) { + kill_entry *k = (kill_entry *) n; kill(k->var, k->write_mask); } } @@ -379,8 +378,8 @@ ir_constant_propagation_visitor::visit_enter(ir_loop *ir) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_iter(exec_list_iterator, iter, *new_kills) { - kill_entry *k = (kill_entry *)iter.get(); + foreach_list(n, new_kills) { + kill_entry *k = (kill_entry *) n; kill(k->var, k->write_mask); } @@ -398,8 +397,8 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask) return; /* Remove any entries currently in the ACP for this kill. */ - foreach_iter(exec_list_iterator, iter, *this->acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list_safe(n, this->acp) { + acp_entry *entry = (acp_entry *) n; if (entry->var == var) { entry->write_mask &= ~write_mask; @@ -411,8 +410,8 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask) /* Add this writemask of the variable to the list of killed * variables in this block. */ - foreach_iter(exec_list_iterator, iter, *this->kills) { - kill_entry *entry = (kill_entry *)iter.get(); + foreach_list(n, this->kills) { + kill_entry *entry = (kill_entry *) n; if (entry->var == var) { entry->write_mask |= write_mask; diff --git a/mesalib/src/glsl/opt_constant_variable.cpp b/mesalib/src/glsl/opt_constant_variable.cpp index a026c51c3..961b8aa06 100644 --- a/mesalib/src/glsl/opt_constant_variable.cpp +++ b/mesalib/src/glsl/opt_constant_variable.cpp @@ -132,10 +132,10 @@ ir_visitor_status ir_constant_variable_visitor::visit_enter(ir_call *ir) { /* Mark any out parameters as assigned to */ - exec_list_iterator sig_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param_rval = (ir_rvalue *)iter.get(); - ir_variable *param = (ir_variable *)sig_iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_rvalue *param_rval = (ir_rvalue *) actual_node; + ir_variable *param = (ir_variable *) formal_node; if (param->data.mode == ir_var_function_out || param->data.mode == ir_var_function_inout) { @@ -146,7 +146,6 @@ ir_constant_variable_visitor::visit_enter(ir_call *ir) entry = get_assignment_entry(var, &this->list); entry->assignment_count++; } - sig_iter.next(); } /* Mark the return storage as having been assigned to */ @@ -194,13 +193,12 @@ do_constant_variable_unlinked(exec_list *instructions) { bool progress = false; - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir_function *f = ir->as_function(); if (f) { - foreach_iter(exec_list_iterator, sigiter, *f) { - ir_function_signature *sig = - (ir_function_signature *) sigiter.get(); + foreach_list(signode, &f->signatures) { + ir_function_signature *sig = (ir_function_signature *) signode; if (do_constant_variable(&sig->body)) progress = true; } diff --git a/mesalib/src/glsl/opt_copy_propagation.cpp b/mesalib/src/glsl/opt_copy_propagation.cpp index db5dfc153..195cc8baa 100644 --- a/mesalib/src/glsl/opt_copy_propagation.cpp +++ b/mesalib/src/glsl/opt_copy_propagation.cpp @@ -167,8 +167,8 @@ ir_copy_propagation_visitor::visit(ir_dereference_variable *ir) ir_variable *var = ir->var; - foreach_iter(exec_list_iterator, iter, *this->acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list(n, this->acp) { + acp_entry *entry = (acp_entry *) n; if (var == entry->lhs) { ir->var = entry->rhs; @@ -185,15 +185,14 @@ ir_visitor_status ir_copy_propagation_visitor::visit_enter(ir_call *ir) { /* Do copy propagation on call parameters, but skip any out params */ - exec_list_iterator sig_param_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { - ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *ir = (ir_rvalue *) actual_node; if (sig_param->data.mode != ir_var_function_out && sig_param->data.mode != ir_var_function_inout) { ir->accept(this); } - sig_param_iter.next(); } /* Since we're unlinked, we don't (necessarily) know the side effects of @@ -217,8 +216,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a copy of the original */ - foreach_iter(exec_list_iterator, iter, *orig_acp) { - acp_entry *a = (acp_entry *)iter.get(); + foreach_list(n, orig_acp) { + acp_entry *a = (acp_entry *) n; this->acp->push_tail(new(this->mem_ctx) acp_entry(a->lhs, a->rhs)); } @@ -233,8 +232,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_iter(exec_list_iterator, iter, *new_kills) { - kill_entry *k = (kill_entry *)iter.get(); + foreach_list(n, new_kills) { + kill_entry *k = (kill_entry *) n; kill(k->var); } } @@ -277,8 +276,8 @@ ir_copy_propagation_visitor::visit_enter(ir_loop *ir) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_iter(exec_list_iterator, iter, *new_kills) { - kill_entry *k = (kill_entry *)iter.get(); + foreach_list(n, new_kills) { + kill_entry *k = (kill_entry *) n; kill(k->var); } @@ -292,8 +291,8 @@ ir_copy_propagation_visitor::kill(ir_variable *var) assert(var != NULL); /* Remove any entries currently in the ACP for this kill. */ - foreach_iter(exec_list_iterator, iter, *acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list_safe(n, acp) { + acp_entry *entry = (acp_entry *) n; if (entry->lhs == var || entry->rhs == var) { entry->remove(); diff --git a/mesalib/src/glsl/opt_copy_propagation_elements.cpp b/mesalib/src/glsl/opt_copy_propagation_elements.cpp index ba8a0f532..cc53e0dd0 100644 --- a/mesalib/src/glsl/opt_copy_propagation_elements.cpp +++ b/mesalib/src/glsl/opt_copy_propagation_elements.cpp @@ -244,8 +244,8 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) /* Try to find ACP entries covering swizzle_chan[], hoping they're * the same source variable. */ - foreach_iter(exec_list_iterator, iter, *this->acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list(n, this->acp) { + acp_entry *entry = (acp_entry *) n; if (var == entry->lhs) { for (int c = 0; c < chans; c++) { @@ -293,15 +293,14 @@ ir_visitor_status ir_copy_propagation_elements_visitor::visit_enter(ir_call *ir) { /* Do copy propagation on call parameters, but skip any out params */ - exec_list_iterator sig_param_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { - ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *ir = (ir_rvalue *) actual_node; if (sig_param->data.mode != ir_var_function_out && sig_param->data.mode != ir_var_function_inout) { ir->accept(this); } - sig_param_iter.next(); } /* Since we're unlinked, we don't (necessarily) know the side effects of @@ -325,8 +324,8 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a copy of the original */ - foreach_iter(exec_list_iterator, iter, *orig_acp) { - acp_entry *a = (acp_entry *)iter.get(); + foreach_list(n, orig_acp) { + acp_entry *a = (acp_entry *) n; this->acp->push_tail(new(this->mem_ctx) acp_entry(a)); } diff --git a/mesalib/src/glsl/opt_dead_builtin_varyings.cpp b/mesalib/src/glsl/opt_dead_builtin_varyings.cpp index a939a2b64..c2a306e7b 100644 --- a/mesalib/src/glsl/opt_dead_builtin_varyings.cpp +++ b/mesalib/src/glsl/opt_dead_builtin_varyings.cpp @@ -512,7 +512,7 @@ do_dead_builtin_varyings(struct gl_context *ctx, tfeedback_decl *tfeedback_decls) { /* Lower the gl_FragData array to separate variables. */ - if (consumer && consumer->Type == GL_FRAGMENT_SHADER) { + if (consumer && consumer->Stage == MESA_SHADER_FRAGMENT) { lower_fragdata_array(consumer->ir); } @@ -574,7 +574,7 @@ do_dead_builtin_varyings(struct gl_context *ctx, * This doesn't prevent elimination of the gl_TexCoord elements which * are not read by the fragment shader. We want to eliminate those anyway. */ - if (consumer->Type == GL_FRAGMENT_SHADER) { + if (consumer->Stage == MESA_SHADER_FRAGMENT) { producer_info.texcoord_usage = (1 << MAX_TEXTURE_COORD_UNITS) - 1; } diff --git a/mesalib/src/glsl/opt_dead_code.cpp b/mesalib/src/glsl/opt_dead_code.cpp index a8d8b4a39..af53d94fd 100644 --- a/mesalib/src/glsl/opt_dead_code.cpp +++ b/mesalib/src/glsl/opt_dead_code.cpp @@ -129,13 +129,12 @@ do_dead_code_unlinked(exec_list *instructions) { bool progress = false; - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir_function *f = ir->as_function(); if (f) { - foreach_iter(exec_list_iterator, sigiter, *f) { - ir_function_signature *sig = - (ir_function_signature *) sigiter.get(); + foreach_list(signode, &f->signatures) { + ir_function_signature *sig = (ir_function_signature *) signode; /* The setting of the uniform_locations_assigned flag here is * irrelevent. If there is a uniform declaration encountered * inside the body of the function, something has already gone diff --git a/mesalib/src/glsl/opt_dead_code_local.cpp b/mesalib/src/glsl/opt_dead_code_local.cpp index 43a01662a..e7d46edbe 100644 --- a/mesalib/src/glsl/opt_dead_code_local.cpp +++ b/mesalib/src/glsl/opt_dead_code_local.cpp @@ -70,8 +70,8 @@ public: void kill_channels(ir_variable *const var, int used) { - foreach_iter(exec_list_iterator, iter, *this->assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list_safe(n, this->assignments) { + assignment_entry *entry = (assignment_entry *) n; if (entry->lhs == var) { if (var->type->is_scalar() || var->type->is_vector()) { @@ -119,8 +119,8 @@ public: /* For the purpose of dead code elimination, emitting a vertex counts as * "reading" all of the currently assigned output variables. */ - foreach_iter(exec_list_iterator, iter, *this->assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list_safe(n, this->assignments) { + assignment_entry *entry = (assignment_entry *) n; if (entry->lhs->data.mode == ir_var_shader_out) { if (debug) printf("kill %s\n", entry->lhs->name); @@ -196,8 +196,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) printf("looking for %s.0x%01x to remove\n", var->name, ir->write_mask); - foreach_iter(exec_list_iterator, iter, *assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list_safe(n, assignments) { + assignment_entry *entry = (assignment_entry *) n; if (entry->lhs != var) continue; @@ -258,8 +258,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) */ if (debug) printf("looking for %s to remove\n", var->name); - foreach_iter(exec_list_iterator, iter, *assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list_safe(n, assignments) { + assignment_entry *entry = (assignment_entry *) n; if (entry->lhs == var) { if (debug) @@ -280,8 +280,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) printf("add %s\n", var->name); printf("current entries\n"); - foreach_iter(exec_list_iterator, iter, *assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list(n, assignments) { + assignment_entry *entry = (assignment_entry *) n; printf(" %s (0x%01x)\n", entry->lhs->name, entry->available); } diff --git a/mesalib/src/glsl/opt_dead_functions.cpp b/mesalib/src/glsl/opt_dead_functions.cpp index cd3b2c12e..8bb278e45 100644 --- a/mesalib/src/glsl/opt_dead_functions.cpp +++ b/mesalib/src/glsl/opt_dead_functions.cpp @@ -74,8 +74,8 @@ public: signature_entry * ir_dead_functions_visitor::get_signature_entry(ir_function_signature *sig) { - foreach_iter(exec_list_iterator, iter, this->signature_list) { - signature_entry *entry = (signature_entry *)iter.get(); + foreach_list(n, &this->signature_list) { + signature_entry *entry = (signature_entry *) n; if (entry->signature == sig) return entry; } @@ -123,8 +123,8 @@ do_dead_functions(exec_list *instructions) * the unused ones, and remove function definitions that have no more * signatures. */ - foreach_iter(exec_list_iterator, iter, v.signature_list) { - signature_entry *entry = (signature_entry *)iter.get(); + foreach_list_safe(n, &v.signature_list) { + signature_entry *entry = (signature_entry *) n; if (!entry->used) { entry->signature->remove(); @@ -137,8 +137,8 @@ do_dead_functions(exec_list *instructions) /* We don't just do this above when we nuked a signature because of * const pointers. */ - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list_safe(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir_function *func = ir->as_function(); if (func && func->signatures.is_empty()) { diff --git a/mesalib/src/glsl/opt_function_inlining.cpp b/mesalib/src/glsl/opt_function_inlining.cpp index c8f42a424..9649598dd 100644 --- a/mesalib/src/glsl/opt_function_inlining.cpp +++ b/mesalib/src/glsl/opt_function_inlining.cpp @@ -107,7 +107,7 @@ ir_call::generate_inline(ir_instruction *next_ir) ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); num_parameters = 0; - foreach_iter(exec_list_iterator, iter_sig, this->callee->parameters) + foreach_list(n, &this->callee->parameters) num_parameters++; parameters = new ir_variable *[num_parameters]; @@ -116,11 +116,10 @@ ir_call::generate_inline(ir_instruction *next_ir) * and set up the mapping of real function body variables to ours. */ i = 0; - exec_list_iterator sig_param_iter = this->callee->parameters.iterator(); - exec_list_iterator param_iter = this->actual_parameters.iterator(); - for (i = 0; i < num_parameters; i++) { - ir_variable *sig_param = (ir_variable *) sig_param_iter.get(); - ir_rvalue *param = (ir_rvalue *) param_iter.get(); + foreach_two_lists(formal_node, &this->callee->parameters, + actual_node, &this->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *param = (ir_rvalue *) actual_node; /* Generate a new variable for the parameter. */ if (sig_param->type->contains_opaque()) { @@ -154,15 +153,14 @@ ir_call::generate_inline(ir_instruction *next_ir) next_ir->insert_before(assign); } - sig_param_iter.next(); - param_iter.next(); + ++i; } exec_list new_instructions; /* Generate the inlined body of the function to a new list */ - foreach_iter(exec_list_iterator, iter, callee->body) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &callee->body) { + ir_instruction *ir = (ir_instruction *) n; ir_instruction *new_ir = ir->clone(ctx, ht); new_instructions.push_tail(new_ir); @@ -172,11 +170,10 @@ ir_call::generate_inline(ir_instruction *next_ir) /* If any opaque types were passed in, replace any deref of the * opaque variable with a deref of the argument. */ - param_iter = this->actual_parameters.iterator(); - sig_param_iter = this->callee->parameters.iterator(); - for (i = 0; i < num_parameters; i++) { - ir_instruction *const param = (ir_instruction *) param_iter.get(); - ir_variable *sig_param = (ir_variable *) sig_param_iter.get(); + foreach_two_lists(formal_node, &this->callee->parameters, + actual_node, &this->actual_parameters) { + ir_rvalue *const param = (ir_rvalue *) actual_node; + ir_variable *sig_param = (ir_variable *) formal_node; if (sig_param->type->contains_opaque()) { ir_dereference *deref = param->as_dereference(); @@ -184,8 +181,6 @@ ir_call::generate_inline(ir_instruction *next_ir) assert(deref); do_variable_replacement(&new_instructions, sig_param, deref); } - param_iter.next(); - sig_param_iter.next(); } /* Now push those new instructions in. */ @@ -195,11 +190,10 @@ ir_call::generate_inline(ir_instruction *next_ir) * variables to our own. */ i = 0; - param_iter = this->actual_parameters.iterator(); - sig_param_iter = this->callee->parameters.iterator(); - for (i = 0; i < num_parameters; i++) { - ir_instruction *const param = (ir_instruction *) param_iter.get(); - const ir_variable *const sig_param = (ir_variable *) sig_param_iter.get(); + foreach_two_lists(formal_node, &this->callee->parameters, + actual_node, &this->actual_parameters) { + ir_rvalue *const param = (ir_rvalue *) actual_node; + const ir_variable *const sig_param = (ir_variable *) formal_node; /* Move our param variable into the actual param if it's an 'out' type. */ if (parameters[i] && (sig_param->data.mode == ir_var_function_out || @@ -212,8 +206,7 @@ ir_call::generate_inline(ir_instruction *next_ir) next_ir->insert_before(assign); } - param_iter.next(); - sig_param_iter.next(); + ++i; } delete [] parameters; @@ -349,8 +342,8 @@ ir_variable_replacement_visitor::visit_leave(ir_dereference_record *ir) ir_visitor_status ir_variable_replacement_visitor::visit_leave(ir_call *ir) { - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param = (ir_rvalue *)iter.get(); + foreach_list_safe(n, &ir->actual_parameters) { + ir_rvalue *param = (ir_rvalue *) n; ir_rvalue *new_param = param; replace_rvalue(&new_param); diff --git a/mesalib/src/glsl/opt_if_simplification.cpp b/mesalib/src/glsl/opt_if_simplification.cpp index db59b131d..2bec8252e 100644 --- a/mesalib/src/glsl/opt_if_simplification.cpp +++ b/mesalib/src/glsl/opt_if_simplification.cpp @@ -90,13 +90,13 @@ ir_if_simplification_visitor::visit_leave(ir_if *ir) * that matters out. */ if (condition_constant->value.b[0]) { - foreach_iter(exec_list_iterator, then_iter, ir->then_instructions) { - ir_instruction *then_ir = (ir_instruction *)then_iter.get(); + foreach_list_safe(n, &ir->then_instructions) { + ir_instruction *then_ir = (ir_instruction *) n; ir->insert_before(then_ir); } } else { - foreach_iter(exec_list_iterator, else_iter, ir->else_instructions) { - ir_instruction *else_ir = (ir_instruction *)else_iter.get(); + foreach_list_safe(n, &ir->else_instructions) { + ir_instruction *else_ir = (ir_instruction *) n; ir->insert_before(else_ir); } } diff --git a/mesalib/src/glsl/opt_structure_splitting.cpp b/mesalib/src/glsl/opt_structure_splitting.cpp index 414f0000d..1ec537b13 100644 --- a/mesalib/src/glsl/opt_structure_splitting.cpp +++ b/mesalib/src/glsl/opt_structure_splitting.cpp @@ -107,8 +107,8 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var) || var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out) return NULL; - foreach_iter(exec_list_iterator, iter, this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, &this->variable_list) { + variable_entry *entry = (variable_entry *) n; if (entry->var == var) return entry; } @@ -209,8 +209,8 @@ ir_structure_splitting_visitor::get_splitting_entry(ir_variable *var) if (!var->type->is_record()) return NULL; - foreach_iter(exec_list_iterator, iter, *this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, this->variable_list) { + variable_entry *entry = (variable_entry *) n; if (entry->var == var) { return entry; } @@ -315,8 +315,8 @@ do_structure_splitting(exec_list *instructions) visit_list_elements(&refs, instructions); /* Trim out variables we can't split. */ - foreach_iter(exec_list_iterator, iter, refs.variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list_safe(n, &refs.variable_list) { + variable_entry *entry = (variable_entry *) n; if (debug) { printf("structure %s@%p: decl %d, whole_access %d\n", @@ -337,8 +337,8 @@ do_structure_splitting(exec_list *instructions) /* Replace the decls of the structures to be split with their split * components. */ - foreach_iter(exec_list_iterator, iter, refs.variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list_safe(n, &refs.variable_list) { + variable_entry *entry = (variable_entry *) n; const struct glsl_type *type = entry->var->type; entry->mem_ctx = ralloc_parent(entry->var); diff --git a/mesalib/src/glsl/opt_tree_grafting.cpp b/mesalib/src/glsl/opt_tree_grafting.cpp index 6d75a1573..f3bd580af 100644 --- a/mesalib/src/glsl/opt_tree_grafting.cpp +++ b/mesalib/src/glsl/opt_tree_grafting.cpp @@ -204,11 +204,10 @@ ir_tree_grafting_visitor::visit_enter(ir_function_signature *ir) ir_visitor_status ir_tree_grafting_visitor::visit_enter(ir_call *ir) { - exec_list_iterator sig_iter = ir->callee->parameters.iterator(); - /* Reminder: iterating ir_call iterates its parameters. */ - foreach_iter(exec_list_iterator, iter, *ir) { - ir_variable *sig_param = (ir_variable *)sig_iter.get(); - ir_rvalue *ir = (ir_rvalue *)iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *ir = (ir_rvalue *) actual_node; ir_rvalue *new_ir = ir; if (sig_param->data.mode != ir_var_function_in @@ -222,7 +221,6 @@ ir_tree_grafting_visitor::visit_enter(ir_call *ir) ir->replace_with(new_ir); return visit_stop; } - sig_iter.next(); } if (ir->return_deref && check_graft(ir, ir->return_deref->var) == visit_stop) diff --git a/mesalib/src/glsl/s_expression.cpp b/mesalib/src/glsl/s_expression.cpp index 1bdf6bca6..6906ff0eb 100644 --- a/mesalib/src/glsl/s_expression.cpp +++ b/mesalib/src/glsl/s_expression.cpp @@ -162,8 +162,8 @@ void s_symbol::print() void s_list::print() { printf("("); - foreach_iter(exec_list_iterator, it, this->subexpressions) { - s_expression *expr = (s_expression*) it.get(); + foreach_list(n, &this->subexpressions) { + s_expression *expr = (s_expression *) n; expr->print(); if (!expr->next->is_tail_sentinel()) printf(" "); @@ -201,11 +201,11 @@ s_match(s_expression *top, unsigned n, s_pattern *pattern, bool partial) return false; unsigned i = 0; - foreach_iter(exec_list_iterator, it, list->subexpressions) { + foreach_list(node, &list->subexpressions) { if (i >= n) return partial; /* More actual items than the pattern expected */ - s_expression *expr = (s_expression *) it.get(); + s_expression *expr = (s_expression *) node; if (expr == NULL || !pattern[i].match(expr)) return false; diff --git a/mesalib/src/glsl/standalone_scaffolding.cpp b/mesalib/src/glsl/standalone_scaffolding.cpp index cbff6d182..257d2e7a9 100644 --- a/mesalib/src/glsl/standalone_scaffolding.cpp +++ b/mesalib/src/glsl/standalone_scaffolding.cpp @@ -76,6 +76,7 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type) shader = rzalloc(NULL, struct gl_shader); if (shader) { shader->Type = type; + shader->Stage = _mesa_shader_enum_to_shader_stage(type); shader->Name = name; shader->RefCount = 1; } @@ -126,16 +127,16 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Const.MaxClipPlanes = 6; ctx->Const.MaxTextureUnits = 2; ctx->Const.MaxTextureCoordUnits = 2; - ctx->Const.VertexProgram.MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 512; - ctx->Const.VertexProgram.MaxOutputComponents = 32; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32; ctx->Const.MaxVarying = 8; /* == gl_MaxVaryingFloats / 4 */ - ctx->Const.VertexProgram.MaxTextureImageUnits = 0; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0; ctx->Const.MaxCombinedTextureImageUnits = 2; - ctx->Const.FragmentProgram.MaxTextureImageUnits = 2; - ctx->Const.FragmentProgram.MaxUniformComponents = 64; - ctx->Const.FragmentProgram.MaxInputComponents = 32; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 2; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 32; ctx->Const.MaxDrawBuffers = 1; @@ -148,6 +149,6 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) /* Default pragma settings */ options.DefaultPragmas.Optimize = true; - for (int sh = 0; sh < MESA_SHADER_TYPES; ++sh) + for (int sh = 0; sh < MESA_SHADER_STAGES; ++sh) memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options)); } diff --git a/mesalib/src/glsl/standalone_scaffolding.h b/mesalib/src/glsl/standalone_scaffolding.h index 9f4818a8a..327fef2df 100644 --- a/mesalib/src/glsl/standalone_scaffolding.h +++ b/mesalib/src/glsl/standalone_scaffolding.h @@ -48,8 +48,8 @@ extern "C" void _mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id, const char *msg, int len); -static inline gl_shader_type -_mesa_shader_type_to_index(GLenum v) +static inline gl_shader_stage +_mesa_shader_enum_to_shader_stage(GLenum v) { switch (v) { case GL_VERTEX_SHADER: @@ -59,7 +59,7 @@ _mesa_shader_type_to_index(GLenum v) case GL_GEOMETRY_SHADER: return MESA_SHADER_GEOMETRY; default: - assert(!"bad value in _mesa_shader_type_to_index()"); + assert(!"bad value in _mesa_shader_enum_to_shader_stage()"); return MESA_SHADER_VERTEX; } } diff --git a/mesalib/src/glsl/test_optpass.cpp b/mesalib/src/glsl/test_optpass.cpp index 67e2ab2b1..1a15f3c63 100644 --- a/mesalib/src/glsl/test_optpass.cpp +++ b/mesalib/src/glsl/test_optpass.cpp @@ -204,11 +204,12 @@ int test_optpass(int argc, char **argv) struct gl_shader *shader = rzalloc(NULL, struct gl_shader); shader->Type = shader_type; + shader->Stage = _mesa_shader_enum_to_shader_stage(shader_type); string input = read_stdin_to_eof(); struct _mesa_glsl_parse_state *state - = new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader); + = new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader); if (input_format_ir) { shader->ir = new(shader) exec_list; @@ -242,7 +243,7 @@ int test_optpass(int argc, char **argv) if (!state->error) { GLboolean progress; const struct gl_shader_compiler_options *options = - &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader_type)]; + &ctx->ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader_type)]; do { progress = do_optimization_passes(shader->ir, &argv[optind], argc - optind, quiet != 0, options); diff --git a/mesalib/src/hgl/GLDispatcher.cpp b/mesalib/src/hgl/GLDispatcher.cpp new file mode 100644 index 000000000..46b91d57c --- /dev/null +++ b/mesalib/src/hgl/GLDispatcher.cpp @@ -0,0 +1,72 @@ +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Brian Paul <brian.e.paul@gmail.com> + * Philippe Houdoin <philippe.houdoin@free.fr> + * Alexander von Gluck IV <kallisti5@unixzen.com> + */ + + +extern "C" { +#include "glapi/glapi.h" +#include "glapi/glapi_priv.h" + +/* + * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints + * (glAccum, glBegin, etc). + * This code IS NOT USED if we're compiling on an x86 system and using + * the glapi_x86.S assembly code. + */ +#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) + +#define KEYWORD1 PUBLIC +#define KEYWORD2 +#define NAME(func) gl##func + +#define DISPATCH(func, args, msg) \ + const struct _glapi_table* dispatch; \ + dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ + (dispatch->func) args + +#define RETURN_DISPATCH(func, args, msg) \ + const struct _glapi_table* dispatch; \ + dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ + return (dispatch->func) args + +#endif +} + + +/* NOTE: this file portion implement a thin OpenGL entrypoints dispatching + C++ wrapper class + */ + +#include "GLDispatcher.h" + +BGLDispatcher::BGLDispatcher() +{ +} + + +BGLDispatcher::~BGLDispatcher() +{ +} + + +status_t +BGLDispatcher::CheckTable(const struct _glapi_table* table) +{ + _glapi_check_table(table ? table : _glapi_get_dispatch()); + return B_OK; +} + + +status_t +BGLDispatcher::SetTable(struct _glapi_table* table) +{ + _glapi_set_dispatch(table); + return B_OK; +} diff --git a/mesalib/src/hgl/GLDispatcher.h b/mesalib/src/hgl/GLDispatcher.h new file mode 100644 index 000000000..44bca8ce5 --- /dev/null +++ b/mesalib/src/hgl/GLDispatcher.h @@ -0,0 +1,109 @@ +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Brian Paul <brian.e.paul@gmail.com> + * Philippe Houdoin <philippe.houdoin@free.fr> + */ +#ifndef GLDISPATCHER_H +#define GLDISPATCHER_H + + +#include <BeBuild.h> +#include <GL/gl.h> +#include <SupportDefs.h> + +#include "glheader.h" + +extern "C" { +#include "glapi/glapi.h" +} + + +class BGLDispatcher +{ + // Private unimplemented copy constructors + BGLDispatcher(const BGLDispatcher &); + BGLDispatcher & operator=(const BGLDispatcher &); + + public: + BGLDispatcher(); + ~BGLDispatcher(); + + void SetCurrentContext(void* context); + void* CurrentContext(); + + struct _glapi_table* Table(); + status_t CheckTable( + const struct _glapi_table* dispatch = NULL); + status_t SetTable(struct _glapi_table* dispatch); + uint32 TableSize(); + + const _glapi_proc operator[](const char* functionName); + const char* operator[](uint32 offset); + + const _glapi_proc AddressOf(const char* functionName); + uint32 OffsetOf(const char* functionName); +}; + + +// Inlines methods +inline void +BGLDispatcher::SetCurrentContext(void* context) +{ + _glapi_set_context(context); +} + + +inline void* +BGLDispatcher::CurrentContext() +{ + return _glapi_get_context(); +} + + +inline struct _glapi_table* +BGLDispatcher::Table() +{ + return _glapi_get_dispatch(); +} + + +inline uint32 +BGLDispatcher::TableSize() +{ + return _glapi_get_dispatch_table_size(); +} + + +inline const _glapi_proc +BGLDispatcher::operator[](const char* functionName) +{ + return _glapi_get_proc_address(functionName); +} + + +inline const char* +BGLDispatcher::operator[](uint32 offset) +{ + return _glapi_get_proc_name((GLuint) offset); +} + + +inline const _glapi_proc +BGLDispatcher::AddressOf(const char* functionName) +{ + return _glapi_get_proc_address(functionName); +} + + +inline uint32 +BGLDispatcher::OffsetOf(const char* functionName) +{ + return (uint32) _glapi_get_proc_offset(functionName); +} + + +#endif // GLDISPATCHER_H diff --git a/mesalib/src/hgl/GLRenderer.cpp b/mesalib/src/hgl/GLRenderer.cpp new file mode 100644 index 000000000..4573a64a3 --- /dev/null +++ b/mesalib/src/hgl/GLRenderer.cpp @@ -0,0 +1,106 @@ +/* + * Copyright 2006-2008, Philippe Houdoin. All rights reserved. + * Distributed under the terms of the MIT License. + */ + + +#include <kernel/image.h> + +#include "GLRenderer.h" + +#include "GLDispatcher.h" + + +BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions, + BGLDispatcher* dispatcher) + : + fRefCount(1), + fView(view), + fOptions(glOptions), + fDispatcher(dispatcher) +{ +} + + +BGLRenderer::~BGLRenderer() +{ + delete fDispatcher; +} + + +void +BGLRenderer::Acquire() +{ + atomic_add(&fRefCount, 1); +} + + +void +BGLRenderer::Release() +{ + if (atomic_add(&fRefCount, -1) < 1) + delete this; +} + + +void +BGLRenderer::LockGL() +{ +} + + +void +BGLRenderer::UnlockGL() +{ +} + + +void +BGLRenderer::SwapBuffers(bool VSync) +{ +} + + +void +BGLRenderer::Draw(BRect updateRect) +{ +} + + +status_t +BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest) +{ + return B_ERROR; +} + + +status_t +BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest) +{ + return B_ERROR; +} + + +void +BGLRenderer::FrameResized(float width, float height) +{ +} + + +void +BGLRenderer::DirectConnected(direct_buffer_info* info) +{ +} + + +void +BGLRenderer::EnableDirectMode(bool enabled) +{ +} + + +status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; } diff --git a/mesalib/src/hgl/GLRendererRoster.cpp b/mesalib/src/hgl/GLRendererRoster.cpp new file mode 100644 index 000000000..1712a871c --- /dev/null +++ b/mesalib/src/hgl/GLRendererRoster.cpp @@ -0,0 +1,224 @@ +/* + * Copyright 2006-2012 Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Philippe Houdoin <philippe.houdoin@free.fr> + * Alexander von Gluck IV <kallisti5@unixzen.com> + */ + + +#include <driver_settings.h> +#include <image.h> + +#include <kernel/image.h> +#include <system/safemode_defs.h> + +#include <Directory.h> +#include <FindDirectory.h> +#include <Path.h> +#include <String.h> +#include "GLDispatcher.h" +#include "GLRendererRoster.h" + +#include <new> +#include <string.h> + + +extern "C" status_t _kern_get_safemode_option(const char* parameter, + char* buffer, size_t* _bufferSize); + + +GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) + : + fNextID(0), + fView(view), + fOptions(options), + fSafeMode(false), + fABISubDirectory(NULL) +{ + char parameter[32]; + size_t parameterLength = sizeof(parameter); + + if (_kern_get_safemode_option(B_SAFEMODE_SAFE_MODE, + parameter, ¶meterLength) == B_OK) { + if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") + || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") + || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) + fSafeMode = true; + } + + if (_kern_get_safemode_option(B_SAFEMODE_DISABLE_USER_ADD_ONS, + parameter, ¶meterLength) == B_OK) { + if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") + || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") + || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) + fSafeMode = true; + } + + // We might run in compatibility mode on a system with a different ABI. The + // renderers matching our ABI can usually be found in respective + // subdirectories of the opengl add-ons directories. + system_info info; + if (get_system_info(&info) == B_OK + && (info.abi & B_HAIKU_ABI_MAJOR) + != (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR)) { + switch (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR) { + case B_HAIKU_ABI_GCC_2: + fABISubDirectory = "gcc2"; + break; + case B_HAIKU_ABI_GCC_4: + fABISubDirectory = "gcc4"; + break; + } + } + + AddDefaultPaths(); +} + + +GLRendererRoster::~GLRendererRoster() +{ + +} + + +BGLRenderer* +GLRendererRoster::GetRenderer(int32 id) +{ + RendererMap::const_iterator iterator = fRenderers.find(id); + if (iterator == fRenderers.end()) + return NULL; + + struct renderer_item item = iterator->second; + return item.renderer; +} + + +void +GLRendererRoster::AddDefaultPaths() +{ + // add user directories first, so that they can override system renderers + const directory_which paths[] = { + B_USER_NONPACKAGED_ADDONS_DIRECTORY, + B_USER_ADDONS_DIRECTORY, + B_SYSTEM_ADDONS_DIRECTORY, + }; + + for (uint32 i = fSafeMode ? 4 : 0; + i < sizeof(paths) / sizeof(paths[0]); i++) { + BPath path; + status_t status = find_directory(paths[i], &path, true); + if (status == B_OK && path.Append("opengl") == B_OK) + AddPath(path.Path()); + } +} + + +status_t +GLRendererRoster::AddPath(const char* path) +{ + BDirectory directory(path); + status_t status = directory.InitCheck(); + if (status < B_OK) + return status; + + // if a subdirectory for our ABI exists, use that instead + if (fABISubDirectory != NULL) { + BEntry entry(&directory, fABISubDirectory); + if (entry.IsDirectory()) { + status = directory.SetTo(&entry); + if (status != B_OK) + return status; + } + } + + node_ref nodeRef; + status = directory.GetNodeRef(&nodeRef); + if (status < B_OK) + return status; + + int32 count = 0; + int32 files = 0; + + entry_ref ref; + BEntry entry; + while (directory.GetNextRef(&ref) == B_OK) { + entry.SetTo(&ref); + if (entry.InitCheck() == B_OK && !entry.IsFile()) + continue; + + if (CreateRenderer(ref) == B_OK) + count++; + + files++; + } + + if (files != 0 && count == 0) + return B_BAD_VALUE; + + return B_OK; +} + + +status_t +GLRendererRoster::AddRenderer(BGLRenderer* renderer, + image_id image, const entry_ref* ref, ino_t node) +{ + renderer_item item; + item.renderer = renderer; + item.image = image; + item.node = node; + if (ref != NULL) + item.ref = *ref; + + try { + fRenderers[fNextID] = item; + } catch (...) { + return B_NO_MEMORY; + } + + renderer->fOwningRoster = this; + renderer->fID = fNextID++; + return B_OK; +} + + +status_t +GLRendererRoster::CreateRenderer(const entry_ref& ref) +{ + BEntry entry(&ref); + node_ref nodeRef; + status_t status = entry.GetNodeRef(&nodeRef); + if (status < B_OK) + return status; + + BPath path(&ref); + image_id image = load_add_on(path.Path()); + if (image < B_OK) + return image; + + BGLRenderer* (*instantiate_renderer) + (BGLView* view, ulong options, BGLDispatcher* dispatcher); + + status = get_image_symbol(image, "instantiate_gl_renderer", + B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer); + if (status == B_OK) { + BGLRenderer* renderer + = instantiate_renderer(fView, fOptions, new BGLDispatcher()); + if (!renderer) { + unload_add_on(image); + return B_UNSUPPORTED; + } + + if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) { + renderer->Release(); + // this will delete the renderer + unload_add_on(image); + } + return B_OK; + } + unload_add_on(image); + + return status; +} diff --git a/mesalib/src/hgl/GLRendererRoster.h b/mesalib/src/hgl/GLRendererRoster.h new file mode 100644 index 000000000..5c8da2711 --- /dev/null +++ b/mesalib/src/hgl/GLRendererRoster.h @@ -0,0 +1,51 @@ +/* + * Copyright 2006-2012, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Philippe Houdoin <philippe.houdoin@free.fr> + */ +#ifndef _GLRENDERER_ROSTER_H +#define _GLRENDERER_ROSTER_H + + +#include <GLRenderer.h> + +#include <map> + + +struct renderer_item { + BGLRenderer* renderer; + entry_ref ref; + ino_t node; + image_id image; +}; + +typedef std::map<renderer_id, renderer_item> RendererMap; + + +class GLRendererRoster { + public: + GLRendererRoster(BGLView* view, ulong options); + virtual ~GLRendererRoster(); + + BGLRenderer* GetRenderer(int32 id = 0); + + private: + void AddDefaultPaths(); + status_t AddPath(const char* path); + status_t AddRenderer(BGLRenderer* renderer, + image_id image, const entry_ref* ref, ino_t node); + status_t CreateRenderer(const entry_ref& ref); + + RendererMap fRenderers; + int32 fNextID; + BGLView* fView; + ulong fOptions; + bool fSafeMode; + const char* fABISubDirectory; + +}; + + +#endif /* _GLRENDERER_ROSTER_H */ diff --git a/mesalib/src/hgl/GLView.cpp b/mesalib/src/hgl/GLView.cpp new file mode 100644 index 000000000..9ae5b5c83 --- /dev/null +++ b/mesalib/src/hgl/GLView.cpp @@ -0,0 +1,643 @@ +/* + * Copyright 2006-2012, Haiku. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Jérôme Duval, korli@users.berlios.de + * Philippe Houdoin, philippe.houdoin@free.fr + * Stefano Ceccherini, burton666@libero.it + */ + +#include <kernel/image.h> + +#include <GLView.h> + +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <DirectWindow.h> +#include <GLRenderer.h> + +#include "interface/DirectWindowPrivate.h" +#include "GLDispatcher.h" +#include "GLRendererRoster.h" + + +struct glview_direct_info { + direct_buffer_info* direct_info; + bool direct_connected; + bool enable_direct_mode; + + glview_direct_info(); + ~glview_direct_info(); +}; + + +BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode, + ulong options) + : + BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), + // | B_FULL_UPDATE_ON_RESIZE) + fGc(NULL), + fOptions(options), + fDitherCount(0), + fDrawLock("BGLView draw lock"), + fDisplayLock("BGLView display lock"), + fClipInfo(NULL), + fRenderer(NULL), + fRoster(NULL), + fDitherMap(NULL) +{ + fRoster = new GLRendererRoster(this, options); +} + + +BGLView::~BGLView() +{ + delete fClipInfo; + if (fRenderer) + fRenderer->Release(); +} + + +void +BGLView::LockGL() +{ + // TODO: acquire the OpenGL API lock it on this glview + + fDisplayLock.Lock(); + if (fRenderer) + fRenderer->LockGL(); +} + + +void +BGLView::UnlockGL() +{ + if (fRenderer) + fRenderer->UnlockGL(); + fDisplayLock.Unlock(); + + // TODO: release the GL API lock to others glviews +} + + +void +BGLView::SwapBuffers() +{ + SwapBuffers(false); +} + + +void +BGLView::SwapBuffers(bool vSync) +{ + if (fRenderer) { + _LockDraw(); + fRenderer->SwapBuffers(vSync); + _UnlockDraw(); + } +} + + +BView* +BGLView::EmbeddedView() +{ + return NULL; +} + + +void* +BGLView::GetGLProcAddress(const char* procName) +{ + BGLDispatcher* glDispatcher = NULL; + + if (fRenderer) + glDispatcher = fRenderer->GLDispatcher(); + + if (glDispatcher) + return (void*)glDispatcher->AddressOf(procName); + + return NULL; +} + + +status_t +BGLView::CopyPixelsOut(BPoint source, BBitmap* dest) +{ + if (!fRenderer) + return B_ERROR; + + if (!dest || !dest->Bounds().IsValid()) + return B_BAD_VALUE; + + return fRenderer->CopyPixelsOut(source, dest); +} + + +status_t +BGLView::CopyPixelsIn(BBitmap* source, BPoint dest) +{ + if (!fRenderer) + return B_ERROR; + + if (!source || !source->Bounds().IsValid()) + return B_BAD_VALUE; + + return fRenderer->CopyPixelsIn(source, dest); +} + + +/*! Mesa's GLenum is not ulong but uint, so we can't use GLenum + without breaking this method signature. + Instead, we have to use the effective BeOS's SGI OpenGL GLenum type: + unsigned long. + */ +void +BGLView::ErrorCallback(unsigned long errorCode) +{ + char msg[32]; + sprintf(msg, "GL: Error code $%04lx.", errorCode); + // TODO: under BeOS R5, it call debugger(msg); + fprintf(stderr, "%s\n", msg); +} + + +void +BGLView::Draw(BRect updateRect) +{ + if (fRenderer) { + _LockDraw(); + fRenderer->Draw(updateRect); + _UnlockDraw(); + return; + } + // TODO: auto-size and center the string + MovePenTo(8, 32); + DrawString("No OpenGL renderer available!"); +} + + +void +BGLView::AttachedToWindow() +{ + BView::AttachedToWindow(); + + fBounds = Bounds(); + for (BView* view = this; view != NULL; view = view->Parent()) + view->ConvertToParent(&fBounds); + + fRenderer = fRoster->GetRenderer(); + if (fRenderer != NULL) { + // Jackburton: The following code was commented because it doesn't look + // good in "direct" mode: + // when the window is moved, the app_server doesn't paint the view's + // background, and the stuff behind the window itself shows up. + // Setting the view color to black, instead, looks a bit more elegant. +#if 0 + // Don't paint white window background when resized + SetViewColor(B_TRANSPARENT_32_BIT); +#else + SetViewColor(0, 0, 0); +#endif + + // Set default OpenGL viewport: + LockGL(); + glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); + UnlockGL(); + fRenderer->FrameResized(Bounds().IntegerWidth(), + Bounds().IntegerHeight()); + + if (fClipInfo) { + fRenderer->DirectConnected(fClipInfo->direct_info); + fRenderer->EnableDirectMode(fClipInfo->enable_direct_mode); + } + + return; + } + + fprintf(stderr, "no renderer found! \n"); + + // No Renderer, no rendering. Setup a minimal "No Renderer" string drawing + // context + SetFont(be_bold_font); + // SetFontSize(16); +} + + +void +BGLView::AllAttached() +{ + BView::AllAttached(); +} + + +void +BGLView::DetachedFromWindow() +{ + if (fRenderer) + fRenderer->Release(); + fRenderer = NULL; + + BView::DetachedFromWindow(); +} + + +void +BGLView::AllDetached() +{ + BView::AllDetached(); +} + + +void +BGLView::FrameResized(float width, float height) +{ + fBounds = Bounds(); + for (BView* v = this; v; v = v->Parent()) + v->ConvertToParent(&fBounds); + + if (fRenderer) { + LockGL(); + _LockDraw(); + _CallDirectConnected(); + fRenderer->FrameResized(width, height); + _UnlockDraw(); + UnlockGL(); + } + + BView::FrameResized(width, height); +} + + +status_t +BGLView::Perform(perform_code d, void* arg) +{ + return BView::Perform(d, arg); +} + + +status_t +BGLView::Archive(BMessage* data, bool deep) const +{ + return BView::Archive(data, deep); +} + + +void +BGLView::MessageReceived(BMessage* msg) +{ + BView::MessageReceived(msg); +} + + +void +BGLView::SetResizingMode(uint32 mode) +{ + BView::SetResizingMode(mode); +} + + +void +BGLView::GetPreferredSize(float* _width, float* _height) +{ + if (_width) + *_width = 0; + if (_height) + *_height = 0; +} + + +void +BGLView::Show() +{ + BView::Show(); +} + + +void +BGLView::Hide() +{ + BView::Hide(); +} + + +BHandler* +BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, + int32 form, const char* property) +{ + return BView::ResolveSpecifier(msg, index, specifier, form, property); +} + + +status_t +BGLView::GetSupportedSuites(BMessage* data) +{ + return BView::GetSupportedSuites(data); +} + + +void +BGLView::DirectConnected(direct_buffer_info* info) +{ + if (fClipInfo == NULL) { + fClipInfo = new (std::nothrow) glview_direct_info(); + if (fClipInfo == NULL) + return; + } + + direct_buffer_info* localInfo = fClipInfo->direct_info; + + switch (info->buffer_state & B_DIRECT_MODE_MASK) { + case B_DIRECT_START: + fClipInfo->direct_connected = true; + memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); + _UnlockDraw(); + break; + + case B_DIRECT_MODIFY: + _LockDraw(); + memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); + _UnlockDraw(); + break; + + case B_DIRECT_STOP: + fClipInfo->direct_connected = false; + _LockDraw(); + break; + } + + if (fRenderer) + _CallDirectConnected(); +} + + +void +BGLView::EnableDirectMode(bool enabled) +{ + if (fRenderer) + fRenderer->EnableDirectMode(enabled); + if (fClipInfo == NULL) { + fClipInfo = new (std::nothrow) glview_direct_info(); + if (fClipInfo == NULL) + return; + } + + fClipInfo->enable_direct_mode = enabled; +} + + +void +BGLView::_LockDraw() +{ + if (!fClipInfo || !fClipInfo->enable_direct_mode) + return; + + fDrawLock.Lock(); +} + + +void +BGLView::_UnlockDraw() +{ + if (!fClipInfo || !fClipInfo->enable_direct_mode) + return; + + fDrawLock.Unlock(); +} + + +void +BGLView::_CallDirectConnected() +{ + if (!fClipInfo) + return; + + direct_buffer_info* localInfo = fClipInfo->direct_info; + direct_buffer_info* info = (direct_buffer_info*)malloc( + DIRECT_BUFFER_INFO_AREA_SIZE); + if (info == NULL) + return; + + memcpy(info, localInfo, DIRECT_BUFFER_INFO_AREA_SIZE); + + // Collect the rects into a BRegion, then clip to the view's bounds + BRegion region; + for (uint32 c = 0; c < localInfo->clip_list_count; c++) + region.Include(localInfo->clip_list[c]); + BRegion boundsRegion = fBounds.OffsetByCopy(localInfo->window_bounds.left, + localInfo->window_bounds.top); + info->window_bounds = boundsRegion.RectAtInt(0); + // window_bounds are now view bounds + region.IntersectWith(&boundsRegion); + + info->clip_list_count = region.CountRects(); + info->clip_bounds = region.FrameInt(); + + for (uint32 c = 0; c < info->clip_list_count; c++) + info->clip_list[c] = region.RectAtInt(c); + fRenderer->DirectConnected(info); + free(info); +} + + +//---- virtual reserved methods ---------- + + +void BGLView::_ReservedGLView1() {} +void BGLView::_ReservedGLView2() {} +void BGLView::_ReservedGLView3() {} +void BGLView::_ReservedGLView4() {} +void BGLView::_ReservedGLView5() {} +void BGLView::_ReservedGLView6() {} +void BGLView::_ReservedGLView7() {} +void BGLView::_ReservedGLView8() {} + + +// #pragma mark - + + +// BeOS compatibility: contrary to others BView's contructors, +// BGLView one wants a non-const name argument. +BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode, + ulong options) + : + BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), + fGc(NULL), + fOptions(options), + fDitherCount(0), + fDrawLock("BGLView draw lock"), + fDisplayLock("BGLView display lock"), + fClipInfo(NULL), + fRenderer(NULL), + fRoster(NULL), + fDitherMap(NULL) +{ + fRoster = new GLRendererRoster(this, options); +} + + +#if 0 +// TODO: implement BGLScreen class... + + +BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options, + status_t* error, bool debug) + : + BWindowScreen(name, screenMode, error, debug) +{ +} + + +BGLScreen::~BGLScreen() +{ +} + + +void +BGLScreen::LockGL() +{ +} + + +void +BGLScreen::UnlockGL() +{ +} + + +void +BGLScreen::SwapBuffers() +{ +} + + +void +BGLScreen::ErrorCallback(unsigned long errorCode) +{ + // Mesa's GLenum is not ulong but uint! + char msg[32]; + sprintf(msg, "GL: Error code $%04lx.", errorCode); + // debugger(msg); + fprintf(stderr, "%s\n", msg); + return; +} + + +void +BGLScreen::ScreenConnected(bool enabled) +{ +} + + +void +BGLScreen::FrameResized(float width, float height) +{ + return BWindowScreen::FrameResized(width, height); +} + + +status_t +BGLScreen::Perform(perform_code d, void* arg) +{ + return BWindowScreen::Perform(d, arg); +} + + +status_t +BGLScreen::Archive(BMessage* data, bool deep) const +{ + return BWindowScreen::Archive(data, deep); +} + + +void +BGLScreen::MessageReceived(BMessage* msg) +{ + BWindowScreen::MessageReceived(msg); +} + + +void +BGLScreen::Show() +{ + BWindowScreen::Show(); +} + + +void +BGLScreen::Hide() +{ + BWindowScreen::Hide(); +} + + +BHandler* +BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, + int32 form, const char* property) +{ + return BWindowScreen::ResolveSpecifier(msg, index, specifier, + form, property); +} + + +status_t +BGLScreen::GetSupportedSuites(BMessage* data) +{ + return BWindowScreen::GetSupportedSuites(data); +} + + +//---- virtual reserved methods ---------- + +void BGLScreen::_ReservedGLScreen1() {} +void BGLScreen::_ReservedGLScreen2() {} +void BGLScreen::_ReservedGLScreen3() {} +void BGLScreen::_ReservedGLScreen4() {} +void BGLScreen::_ReservedGLScreen5() {} +void BGLScreen::_ReservedGLScreen6() {} +void BGLScreen::_ReservedGLScreen7() {} +void BGLScreen::_ReservedGLScreen8() {} +#endif + + +const char* color_space_name(color_space space) +{ +#define C2N(a) case a: return #a + + switch (space) { + C2N(B_RGB24); + C2N(B_RGB32); + C2N(B_RGBA32); + C2N(B_RGB32_BIG); + C2N(B_RGBA32_BIG); + C2N(B_GRAY8); + C2N(B_GRAY1); + C2N(B_RGB16); + C2N(B_RGB15); + C2N(B_RGBA15); + C2N(B_CMAP8); + default: + return "Unknown!"; + }; + +#undef C2N +}; + + +glview_direct_info::glview_direct_info() +{ + // TODO: See direct_window_data() in app_server's ServerWindow.cpp + direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); + direct_connected = false; + enable_direct_mode = false; +} + + +glview_direct_info::~glview_direct_info() +{ + free(direct_info); +} + diff --git a/mesalib/src/hgl/SConscript b/mesalib/src/hgl/SConscript new file mode 100644 index 000000000..70db1494d --- /dev/null +++ b/mesalib/src/hgl/SConscript @@ -0,0 +1,36 @@ +####################################################################### +# SConscript for Haiku OpenGL kit + +Import('*') + +env = env.Clone() + +env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', + '#/src/mesa/main', + '#/include/HaikuGL', + '/boot/system/develop/headers/private', + Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers +]) + +env.Prepend(LIBS = [ + glapi +]) + +sources = [ + 'GLView.cpp', + 'GLRenderer.cpp', + 'GLRendererRoster.cpp', + 'GLDispatcher.cpp', +] + +# libGL.so +libgl = env.SharedLibrary( + target ='GL', + source = sources, + SHLIBSUFFIX = env['SHLIBSUFFIX'], +) + +env.Alias('libgl-haiku', libgl) +Export('libgl') diff --git a/mesalib/src/mapi/glapi/gen/ARB_shader_image_load_store.xml b/mesalib/src/mapi/glapi/gen/ARB_shader_image_load_store.xml new file mode 100644 index 000000000..7ccfca41d --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/ARB_shader_image_load_store.xml @@ -0,0 +1,89 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> + +<OpenGLAPI> + +<category name="GL_ARB_shader_image_load_store" number="115"> + +<enum name="VERTEX_ATTRIB_ARRAY_BARRIER_BIT" value="0x00000001"/> +<enum name="ELEMENT_ARRAY_BARRIER_BIT" value="0x00000002"/> +<enum name="UNIFORM_BARRIER_BIT" value="0x00000004"/> +<enum name="TEXTURE_FETCH_BARRIER_BIT" value="0x00000008"/> +<enum name="SHADER_IMAGE_ACCESS_BARRIER_BIT" value="0x00000020"/> +<enum name="COMMAND_BARRIER_BIT" value="0x00000040"/> +<enum name="PIXEL_BUFFER_BARRIER_BIT" value="0x00000080"/> +<enum name="TEXTURE_UPDATE_BARRIER_BIT" value="0x00000100"/> +<enum name="BUFFER_UPDATE_BARRIER_BIT" value="0x00000200"/> +<enum name="FRAMEBUFFER_BARRIER_BIT" value="0x00000400"/> +<enum name="TRANSFORM_FEEDBACK_BARRIER_BIT" value="0x00000800"/> +<enum name="ATOMIC_COUNTER_BARRIER_BIT" value="0x00001000"/> +<enum name="ALL_BARRIER_BITS" value="0xFFFFFFFF"/> +<enum name="MAX_IMAGE_UNITS" value="0x8F38"/> +<enum name="MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS" value="0x8F39"/> +<enum name="IMAGE_BINDING_NAME" value="0x8F3A"/> +<enum name="IMAGE_BINDING_LEVEL" value="0x8F3B"/> +<enum name="IMAGE_BINDING_LAYERED" value="0x8F3C"/> +<enum name="IMAGE_BINDING_LAYER" value="0x8F3D"/> +<enum name="IMAGE_BINDING_ACCESS" value="0x8F3E"/> +<enum name="IMAGE_1D" value="0x904C"/> +<enum name="IMAGE_2D" value="0x904D"/> +<enum name="IMAGE_3D" value="0x904E"/> +<enum name="IMAGE_2D_RECT" value="0x904F"/> +<enum name="IMAGE_CUBE" value="0x9050"/> +<enum name="IMAGE_BUFFER" value="0x9051"/> +<enum name="IMAGE_1D_ARRAY" value="0x9052"/> +<enum name="IMAGE_2D_ARRAY" value="0x9053"/> +<enum name="IMAGE_CUBE_MAP_ARRAY" value="0x9054"/> +<enum name="IMAGE_2D_MULTISAMPLE" value="0x9055"/> +<enum name="IMAGE_2D_MULTISAMPLE_ARRAY" value="0x9056"/> +<enum name="INT_IMAGE_1D" value="0x9057"/> +<enum name="INT_IMAGE_2D" value="0x9058"/> +<enum name="INT_IMAGE_3D" value="0x9059"/> +<enum name="INT_IMAGE_2D_RECT" value="0x905A"/> +<enum name="INT_IMAGE_CUBE" value="0x905B"/> +<enum name="INT_IMAGE_BUFFER" value="0x905C"/> +<enum name="INT_IMAGE_1D_ARRAY" value="0x905D"/> +<enum name="INT_IMAGE_2D_ARRAY" value="0x905E"/> +<enum name="INT_IMAGE_CUBE_MAP_ARRAY" value="0x905F"/> +<enum name="INT_IMAGE_2D_MULTISAMPLE" value="0x9060"/> +<enum name="INT_IMAGE_2D_MULTISAMPLE_ARRAY" value="0x9061"/> +<enum name="UNSIGNED_INT_IMAGE_1D" value="0x9062"/> +<enum name="UNSIGNED_INT_IMAGE_2D" value="0x9063"/> +<enum name="UNSIGNED_INT_IMAGE_3D" value="0x9064"/> +<enum name="UNSIGNED_INT_IMAGE_2D_RECT" value="0x9065"/> +<enum name="UNSIGNED_INT_IMAGE_CUBE" value="0x9066"/> +<enum name="UNSIGNED_INT_IMAGE_BUFFER" value="0x9067"/> +<enum name="UNSIGNED_INT_IMAGE_1D_ARRAY" value="0x9068"/> +<enum name="UNSIGNED_INT_IMAGE_2D_ARRAY" value="0x9069"/> +<enum name="UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY" value="0x906A"/> +<enum name="UNSIGNED_INT_IMAGE_2D_MULTISAMPLE" value="0x906B"/> +<enum name="UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY" value="0x906C"/> +<enum name="MAX_IMAGE_SAMPLES" value="0x906D"/> +<enum name="IMAGE_BINDING_FORMAT" value="0x906E"/> +<enum name="IMAGE_FORMAT_COMPATIBILITY_TYPE" value="0x90C7"/> +<enum name="IMAGE_FORMAT_COMPATIBILITY_BY_SIZE" value="0x90C8"/> +<enum name="IMAGE_FORMAT_COMPATIBILITY_BY_CLASS" value="0x90C9"/> +<enum name="MAX_VERTEX_IMAGE_UNIFORMS" value="0x90CA"/> +<enum name="MAX_TESS_CONTROL_IMAGE_UNIFORMS" value="0x90CB"/> +<enum name="MAX_TESS_EVALUATION_IMAGE_UNIFORMS" value="0x90CC"/> +<enum name="MAX_GEOMETRY_IMAGE_UNIFORMS" value="0x90CD"/> +<enum name="MAX_FRAGMENT_IMAGE_UNIFORMS" value="0x90CE"/> +<enum name="MAX_COMBINED_IMAGE_UNIFORMS" value="0x90CF"/> + +<function name="BindImageTexture" offset="assign"> + <param name="unit" type="GLuint"/> + <param name="texture" type="GLuint"/> + <param name="level" type="GLint"/> + <param name="layered" type="GLboolean"/> + <param name="layer" type="GLint"/> + <param name="access" type="GLenum"/> + <param name="format" type="GLenum"/> +</function> + +<function name="MemoryBarrier" offset="assign"> + <param name="barriers" type="GLbitfield"/> +</function> + +</category> + +</OpenGLAPI> diff --git a/mesalib/src/mapi/glapi/gen/Makefile.am b/mesalib/src/mapi/glapi/gen/Makefile.am index 65bd9137c..d5c20b71e 100644 --- a/mesalib/src/mapi/glapi/gen/Makefile.am +++ b/mesalib/src/mapi/glapi/gen/Makefile.am @@ -113,6 +113,7 @@ API_XML = \ ARB_sampler_objects.xml \ ARB_seamless_cube_map.xml \ ARB_shader_atomic_counters.xml \ + ARB_shader_image_load_store.xml \ ARB_sync.xml \ ARB_texture_buffer_object.xml \ ARB_texture_buffer_range.xml \ diff --git a/mesalib/src/mapi/glapi/gen/glX_proto_send.py b/mesalib/src/mapi/glapi/gen/glX_proto_send.py index f4d519f14..8b804418b 100755 --- a/mesalib/src/mapi/glapi/gen/glX_proto_send.py +++ b/mesalib/src/mapi/glapi/gen/glX_proto_send.py @@ -971,6 +971,8 @@ struct _glapi_table * __glXNewIndirectAPI( void ) entries = _glapi_get_dispatch_table_size(); table = malloc(entries * sizeof(_glapi_proc)); + if (table == NULL) + return NULL; /* first, set all entries to point to no-op functions */ for (i = 0; i < entries; i++) { diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml index c51eb5f4c..5928d1493 100755 --- a/mesalib/src/mapi/glapi/gen/gl_API.xml +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml @@ -8312,6 +8312,8 @@ <xi:include href="ARB_shader_atomic_counters.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> +<xi:include href="ARB_shader_image_load_store.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + <xi:include href="ARB_texture_storage.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> <!-- ARB extension #118 --> diff --git a/mesalib/src/mapi/glapi/gen/gl_genexec.py b/mesalib/src/mapi/glapi/gen/gl_genexec.py index b557b3b99..b7ac16b06 100644 --- a/mesalib/src/mapi/glapi/gen/gl_genexec.py +++ b/mesalib/src/mapi/glapi/gen/gl_genexec.py @@ -108,6 +108,7 @@ header = """/** #include "main/varray.h" #include "main/viewport.h" #include "main/shaderapi.h" +#include "main/shaderimage.h" #include "main/uniforms.h" #include "main/syncobj.h" #include "main/formatquery.h" diff --git a/mesalib/src/mesa/Makefile.am b/mesalib/src/mesa/Makefile.am index 884383652..cb038a5eb 100644 --- a/mesalib/src/mesa/Makefile.am +++ b/mesalib/src/mesa/Makefile.am @@ -36,18 +36,18 @@ endif gldir = $(includedir)/GL gl_HEADERS = $(top_srcdir)/include/GL/*.h -.PHONY: main/git_sha1.h.tmp -main/git_sha1.h.tmp: +.PHONY: $(BUILDDIR)main/git_sha1.h.tmp +$(BUILDDIR)main/git_sha1.h.tmp: @touch main/git_sha1.h.tmp - @if test -d ../../.git; then \ + @if test -d $(top_srcdir)/.git; then \ if which git > /dev/null; then \ - git log -n 1 --oneline | \ + git --git-dir=$(top_srcdir)/.git log -n 1 --oneline | \ sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \ > main/git_sha1.h.tmp ; \ fi \ fi -main/git_sha1.h: main/git_sha1.h.tmp +$(BUILDDIR)main/git_sha1.h: $(BUILDDIR)main/git_sha1.h.tmp @echo "updating main/git_sha1.h" @if ! cmp -s main/git_sha1.h.tmp main/git_sha1.h; then \ mv main/git_sha1.h.tmp main/git_sha1.h ;\ @@ -63,8 +63,8 @@ BUILDDIR = $(builddir)/ include Makefile.sources BUILT_SOURCES = \ - main/git_sha1.h \ main/get_hash.h \ + $(BUILDDIR)main/git_sha1.h \ $(BUILDDIR)program/program_parse.tab.c \ $(BUILDDIR)program/lex.yy.c CLEANFILES = \ diff --git a/mesalib/src/mesa/Makefile.sources b/mesalib/src/mesa/Makefile.sources index 39525bc5b..d14823db9 100644 --- a/mesalib/src/mesa/Makefile.sources +++ b/mesalib/src/mesa/Makefile.sources @@ -81,6 +81,7 @@ MAIN_FILES = \ $(SRCDIR)main/scissor.c \ $(SRCDIR)main/set.c \ $(SRCDIR)main/shaderapi.c \ + $(SRCDIR)main/shaderimage.c \ $(SRCDIR)main/shaderobj.c \ $(SRCDIR)main/shader_query.cpp \ $(SRCDIR)main/shared.c \ diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript index bb9b304ef..77e2aaa7e 100644 --- a/mesalib/src/mesa/SConscript +++ b/mesalib/src/mesa/SConscript @@ -110,6 +110,7 @@ main_sources = [ 'main/scissor.c', 'main/set.c', 'main/shaderapi.c', + 'main/shaderimage.c', 'main/shaderobj.c', 'main/shader_query.cpp', 'main/shared.c', diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c index f18568827..e8dcb2476 100644 --- a/mesalib/src/mesa/drivers/common/driverfuncs.c +++ b/mesalib/src/mesa/drivers/common/driverfuncs.c @@ -302,8 +302,7 @@ _mesa_init_driver_state(struct gl_context *ctx) ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp); ctx->Driver.PointSize(ctx, ctx->Point.Size); ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple); - ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, - ctx->Scissor.Width, ctx->Scissor.Height); + ctx->Driver.Scissor(ctx); ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel); ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, ctx->Stencil.Function[0], diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index 7b41876b9..129451471 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -2407,9 +2407,9 @@ _mesa_meta_glsl_Clear(struct gl_context *ctx, GLbitfield buffers) GL_DYNAMIC_DRAW_ARB); /* draw quad(s) */ - if (fb->NumLayers > 0) { + if (fb->MaxNumLayers > 0) { unsigned layer; - for (layer = 0; layer < fb->NumLayers; layer++) { + for (layer = 0; layer < fb->MaxNumLayers; layer++) { if (fb->_IntegerColor) _mesa_Uniform1i(clear->IntegerLayerLocation, layer); else diff --git a/mesalib/src/mesa/drivers/dri/common/utils.c b/mesalib/src/mesa/drivers/dri/common/utils.c index 9c9483209..3e35fe2d0 100644 --- a/mesalib/src/mesa/drivers/dri/common/utils.c +++ b/mesalib/src/mesa/drivers/dri/common/utils.c @@ -308,6 +308,7 @@ driCreateConfigs(gl_format format, __DRI_ATTRIB_TEXTURE_2D_BIT | __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT; + modes->yInverted = GL_TRUE; modes->sRGBCapable = is_srgb; } } diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index 1848da5d9..cddab6526 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -623,15 +623,11 @@ update_state( struct gl_context *ctx, GLuint new_state ) } static void -viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h) +viewport(struct gl_context *ctx) { struct gl_framebuffer *draw = ctx->WinSysDrawBuffer; struct gl_framebuffer *read = ctx->WinSysReadBuffer; - (void) x; - (void) y; - (void) w; - (void) h; swrast_check_and_update_window_size(ctx, draw); swrast_check_and_update_window_size(ctx, read); } diff --git a/mesalib/src/mesa/drivers/haiku/swrast/SConscript b/mesalib/src/mesa/drivers/haiku/swrast/SConscript index 71ce88e20..aef730098 100644 --- a/mesalib/src/mesa/drivers/haiku/swrast/SConscript +++ b/mesalib/src/mesa/drivers/haiku/swrast/SConscript @@ -6,6 +6,7 @@ env.Append(CPPPATH = [ '#/src/mapi', '#/src/mesa', '#/src/mesa/main', + '#/include/HaikuGL', '/boot/system/develop/headers/private', Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers ]) @@ -15,6 +16,8 @@ env.Prepend(LIBS = [ mesa, ]) +env.Prepend(LIBS = [libgl]) + sources = [ 'SoftwareRast.cpp' ] diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c index d6eb82392..c1a9c28b1 100644 --- a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c +++ b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c @@ -484,9 +484,7 @@ wmesa_resize_buffers(struct gl_context *ctx, struct gl_framebuffer *buffer, * we get the viewport set correctly, even if the app does not call * glViewport and relies on the defaults. */ -static void wmesa_viewport(struct gl_context *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height) +static void wmesa_viewport(struct gl_context *ctx) { GLuint new_width, new_height; diff --git a/mesalib/src/mesa/main/arbprogram.c b/mesalib/src/mesa/main/arbprogram.c index 8bd3f0bd0..247b49253 100644 --- a/mesalib/src/mesa/main/arbprogram.c +++ b/mesalib/src/mesa/main/arbprogram.c @@ -247,12 +247,12 @@ get_local_param_pointer(struct gl_context *ctx, const char *func, if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { prog = &(ctx->VertexProgram.Current->Base); - maxParams = ctx->Const.VertexProgram.MaxLocalParams; + maxParams = ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams; } else if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { prog = &(ctx->FragmentProgram.Current->Base); - maxParams = ctx->Const.FragmentProgram.MaxLocalParams; + maxParams = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -282,7 +282,7 @@ get_env_param_pointer(struct gl_context *ctx, const char *func, { if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { - if (index >= ctx->Const.FragmentProgram.MaxEnvParams) { + if (index >= ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func); return GL_FALSE; } @@ -291,7 +291,7 @@ get_env_param_pointer(struct gl_context *ctx, const char *func, } else if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { - if (index >= ctx->Const.VertexProgram.MaxEnvParams) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func); return GL_FALSE; } @@ -436,7 +436,7 @@ _mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { - if ((index + count) > ctx->Const.FragmentProgram.MaxEnvParams) { + if ((index + count) > ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)"); return; } @@ -444,7 +444,7 @@ _mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, } else if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { - if ((index + count) > ctx->Const.VertexProgram.MaxEnvParams) { + if ((index + count) > ctx->Const.Program[MESA_SHADER_VERTEX].MaxEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)"); return; } @@ -527,28 +527,20 @@ _mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fv(count)"); } - if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - if ((index + count) > ctx->Const.FragmentProgram.MaxLocalParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)"); - return; - } - dest = ctx->FragmentProgram.Current->Base.LocalParams[index]; - } - else if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { - if ((index + count) > ctx->Const.VertexProgram.MaxLocalParams) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)"); + if (get_local_param_pointer(ctx, "glProgramLocalParameters4fvEXT", + target, index, &dest)) { + GLuint maxParams = target == GL_FRAGMENT_PROGRAM_ARB ? + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams : + ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams; + + if ((index + count) > maxParams) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glProgramLocalParameters4fvEXT(index + count)"); return; } - dest = ctx->VertexProgram.Current->Base.LocalParams[index]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameters4fvEXT(target)"); - return; - } - memcpy(dest, params, count * 4 * sizeof(GLfloat)); + memcpy(dest, params, count * 4 * sizeof(GLfloat)); + } } @@ -610,12 +602,12 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { prog = &(ctx->VertexProgram.Current->Base); - limits = &ctx->Const.VertexProgram; + limits = &ctx->Const.Program[MESA_SHADER_VERTEX]; } else if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { prog = &(ctx->FragmentProgram.Current->Base); - limits = &ctx->Const.FragmentProgram; + limits = &ctx->Const.Program[MESA_SHADER_FRAGMENT]; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(target)"); diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c index f0b525fa0..077c5fca3 100644 --- a/mesalib/src/mesa/main/clear.c +++ b/mesalib/src/mesa/main/clear.c @@ -179,7 +179,11 @@ _mesa_Clear( GLbitfield mask ) if (mask & GL_COLOR_BUFFER_BIT) { GLuint i; for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { - bufferMask |= (1 << ctx->DrawBuffer->_ColorDrawBufferIndexes[i]); + GLint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[i]; + + if (buf >= 0) { + bufferMask |= 1 << buf; + } } } @@ -274,7 +278,7 @@ make_color_buffer_mask(struct gl_context *ctx, GLint drawbuffer) break; default: { - GLuint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[drawbuffer]; + GLint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[drawbuffer]; if (buf >= 0 && att[buf].Renderbuffer) { mask |= 1 << buf; diff --git a/mesalib/src/mesa/main/condrender.c b/mesalib/src/mesa/main/condrender.c index 2632f7a1a..0ad1e5c2a 100644 --- a/mesalib/src/mesa/main/condrender.c +++ b/mesalib/src/mesa/main/condrender.c @@ -40,17 +40,38 @@ void GLAPIENTRY _mesa_BeginConditionalRender(GLuint queryId, GLenum mode) { - struct gl_query_object *q; + struct gl_query_object *q = NULL; GET_CURRENT_CONTEXT(ctx); - if (!ctx->Extensions.NV_conditional_render || ctx->Query.CondRenderQuery || - queryId == 0) { + /* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says: + * + * "If BeginConditionalRender is called while conditional rendering is + * in progress, or if EndConditionalRender is called while conditional + * rendering is not in progress, the error INVALID_OPERATION is + * generated." + */ + if (!ctx->Extensions.NV_conditional_render || ctx->Query.CondRenderQuery) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginConditionalRender()"); return; } ASSERT(ctx->Query.CondRenderMode == GL_NONE); + /* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says: + * + * "The error INVALID_VALUE is generated if <id> is not the name of an + * existing query object query." + */ + if (queryId != 0) + q = _mesa_lookup_query_object(ctx, queryId); + + if (!q) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glBeginConditionalRender(bad queryId=%u)", queryId); + return; + } + ASSERT(q->Id == queryId); + switch (mode) { case GL_QUERY_WAIT: case GL_QUERY_NO_WAIT: @@ -64,14 +85,12 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode) return; } - q = _mesa_lookup_query_object(ctx, queryId); - if (!q) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glBeginConditionalRender(bad queryId=%u)", queryId); - return; - } - ASSERT(q->Id == queryId); - + /* Section 2.14 (Conditional Rendering) of the OpenGL 3.0 spec says: + * + * "The error INVALID_OPERATION is generated if <id> is the name of a + * query object with a target other than SAMPLES_PASSED, or <id> is the + * name of a query currently in progress." + */ if ((q->Target != GL_SAMPLES_PASSED && q->Target != GL_ANY_SAMPLES_PASSED && q->Target != GL_ANY_SAMPLES_PASSED_CONSERVATIVE) || q->Active) { diff --git a/mesalib/src/mesa/main/config.h b/mesalib/src/mesa/main/config.h index ebf99c24b..1e1cfb6c5 100644 --- a/mesalib/src/mesa/main/config.h +++ b/mesalib/src/mesa/main/config.h @@ -179,6 +179,9 @@ #define MAX_COMBINED_ATOMIC_BUFFERS (MAX_UNIFORM_BUFFERS * 6) /* Size of an atomic counter in bytes according to ARB_shader_atomic_counters */ #define ATOMIC_COUNTER_SIZE 4 +#define MAX_IMAGE_UNIFORMS 16 +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_IMAGE_UNITS (MAX_IMAGE_UNIFORMS * 6) /*@}*/ /** diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 4db27da9a..4f7bdbdbc 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -461,7 +461,7 @@ _mesa_init_current(struct gl_context *ctx) * Important: drivers should override these with actual limits. */ static void -init_program_limits(struct gl_context *ctx, GLenum type, +init_program_limits(struct gl_context *ctx, gl_shader_stage stage, struct gl_program_constants *prog) { prog->MaxInstructions = MAX_PROGRAM_INSTRUCTIONS; @@ -473,8 +473,8 @@ init_program_limits(struct gl_context *ctx, GLenum type, prog->MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS; prog->MaxAddressOffset = MAX_PROGRAM_LOCAL_PARAMS; - switch (type) { - case GL_VERTEX_PROGRAM_ARB: + switch (stage) { + case MESA_SHADER_VERTEX: prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS; prog->MaxAttribs = MAX_VERTEX_GENERIC_ATTRIBS; prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; @@ -482,7 +482,7 @@ init_program_limits(struct gl_context *ctx, GLenum type, prog->MaxInputComponents = 0; /* value not used */ prog->MaxOutputComponents = 16 * 4; /* old limit not to break tnl and swrast */ break; - case GL_FRAGMENT_PROGRAM_ARB: + case MESA_SHADER_FRAGMENT: prog->MaxParameters = MAX_NV_FRAGMENT_PROGRAM_PARAMS; prog->MaxAttribs = MAX_NV_FRAGMENT_PROGRAM_INPUTS; prog->MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS; @@ -490,7 +490,7 @@ init_program_limits(struct gl_context *ctx, GLenum type, prog->MaxInputComponents = 16 * 4; /* old limit not to break tnl and swrast */ prog->MaxOutputComponents = 0; /* value not used */ break; - case MESA_GEOMETRY_PROGRAM: + case MESA_SHADER_GEOMETRY: prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS; prog->MaxAttribs = MAX_VERTEX_GENERIC_ATTRIBS; prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; @@ -499,7 +499,7 @@ init_program_limits(struct gl_context *ctx, GLenum type, prog->MaxOutputComponents = 16 * 4; /* old limit not to break tnl and swrast */ break; default: - assert(0 && "Bad program type in init_program_limits()"); + assert(0 && "Bad shader stage in init_program_limits()"); } /* Set the native limits to zero. This implies that there is no native @@ -551,6 +551,7 @@ init_program_limits(struct gl_context *ctx, GLenum type, static void _mesa_init_constants(struct gl_context *ctx) { + int i; assert(ctx); /* Constants, may be overriden (usually only reduced) by device drivers */ @@ -561,9 +562,9 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE; ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS; ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS; - ctx->Const.FragmentProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, - ctx->Const.FragmentProgram.MaxTextureImageUnits); + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits); ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY; ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS; ctx->Const.MaxTextureBufferSize = 65536; @@ -593,9 +594,8 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxUniformBlockSize = 16384; ctx->Const.UniformBufferOffsetAlignment = 1; - init_program_limits(ctx, GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram); - init_program_limits(ctx, GL_FRAGMENT_PROGRAM_ARB, &ctx->Const.FragmentProgram); - init_program_limits(ctx, MESA_GEOMETRY_PROGRAM, &ctx->Const.GeometryProgram); + for (i = 0; i < MESA_SHADER_STAGES; i++) + init_program_limits(ctx, i, &ctx->Const.Program[i]); ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES; ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH; @@ -609,10 +609,10 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS; ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE; - ctx->Const.VertexProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS; ctx->Const.MaxVarying = 16; /* old limit not to break tnl and swrast */ - ctx->Const.GeometryProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES; ctx->Const.MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS; @@ -699,24 +699,24 @@ check_context_limits(struct gl_context *ctx) (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead))); /* shader-related checks */ - assert(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); - assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); + assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); + assert(ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); /* Texture unit checks */ - assert(ctx->Const.FragmentProgram.MaxTextureImageUnits > 0); - assert(ctx->Const.FragmentProgram.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS); + assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits > 0); + assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxTextureCoordUnits > 0); assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS); assert(ctx->Const.MaxTextureUnits > 0); assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS); - assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.FragmentProgram.MaxTextureImageUnits, + assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits)); assert(ctx->Const.MaxCombinedTextureImageUnits > 0); assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS); /* number of coord units cannot be greater than number of image units */ - assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.FragmentProgram.MaxTextureImageUnits); + assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits); /* Texture size checks */ @@ -1851,14 +1851,14 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where) #ifdef DEBUG if (ctx->Shader.Flags & GLSL_LOG) { - struct gl_shader_program *shProg[MESA_SHADER_TYPES]; - gl_shader_type i; + struct gl_shader_program *shProg[MESA_SHADER_STAGES]; + gl_shader_stage i; shProg[MESA_SHADER_VERTEX] = ctx->Shader.CurrentVertexProgram; shProg[MESA_SHADER_GEOMETRY] = ctx->Shader.CurrentGeometryProgram; shProg[MESA_SHADER_FRAGMENT] = ctx->Shader.CurrentFragmentProgram; - for (i = 0; i < MESA_SHADER_TYPES; i++) { + for (i = 0; i < MESA_SHADER_STAGES; i++) { if (shProg[i] == NULL || shProg[i]->_Used || shProg[i]->_LinkedShaders[i] == NULL) continue; @@ -1875,7 +1875,7 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where) _mesa_append_uniforms_to_file(shProg[i]->_LinkedShaders[i]); } - for (i = 0; i < MESA_SHADER_TYPES; i++) { + for (i = 0; i < MESA_SHADER_STAGES; i++) { if (shProg[i] != NULL) shProg[i]->_Used = GL_TRUE; } diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h index 6e73691ea..6c084afa3 100644 --- a/mesalib/src/mesa/main/dd.h +++ b/mesalib/src/mesa/main/dd.h @@ -39,6 +39,7 @@ struct gl_buffer_object; struct gl_context; struct gl_display_list; struct gl_framebuffer; +struct gl_image_unit; struct gl_pixelstore_attrib; struct gl_program; struct gl_renderbuffer; @@ -484,7 +485,7 @@ struct dd_function_table { /** Enable or disable writing into the depth buffer */ void (*DepthMask)(struct gl_context *ctx, GLboolean flag); /** Specify mapping of depth values from NDC to window coordinates */ - void (*DepthRange)(struct gl_context *ctx, GLclampd nearval, GLclampd farval); + void (*DepthRange)(struct gl_context *ctx); /** Specify the current buffer for writing */ void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer ); /** Specify the buffers for writing for fragment programs*/ @@ -524,7 +525,7 @@ struct dd_function_table { /** Set rasterization mode */ void (*RenderMode)(struct gl_context *ctx, GLenum mode ); /** Define the scissor box */ - void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h); + void (*Scissor)(struct gl_context *ctx); /** Select flat or smooth shading */ void (*ShadeModel)(struct gl_context *ctx, GLenum mode); /** OpenGL 2.0 two-sided StencilFunc */ @@ -546,7 +547,7 @@ struct dd_function_table { struct gl_texture_object *texObj, GLenum pname, const GLfloat *params); /** Set the viewport */ - void (*Viewport)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h); + void (*Viewport)(struct gl_context *ctx); /*@}*/ @@ -910,6 +911,19 @@ struct dd_function_table { * non-zero status should be returned for the duration of the reset. */ GLenum (*GetGraphicsResetStatus)(struct gl_context *ctx); + + /** + * \name GL_ARB_shader_image_load_store interface. + */ + /** @{ */ + void (*BindImageTexture)(struct gl_context *ctx, + struct gl_image_unit *unit, + struct gl_texture_object *texObj, + GLint level, GLboolean layered, GLint layer, + GLenum access, GLenum format); + + void (*MemoryBarrier)(struct gl_context *ctx, GLbitfield barriers); + /** @} */ }; diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index f0e1858e4..2e0ccc3b6 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -126,6 +126,7 @@ static const struct extension extension_table[] = { { "GL_ARB_seamless_cube_map", o(ARB_seamless_cube_map), GL, 2009 }, { "GL_ARB_shader_atomic_counters", o(ARB_shader_atomic_counters), GL, 2011 }, { "GL_ARB_shader_bit_encoding", o(ARB_shader_bit_encoding), GL, 2010 }, + { "GL_ARB_shader_image_load_store", o(ARB_shader_image_load_store), GL, 2011 }, { "GL_ARB_shader_objects", o(dummy_true), GL, 2002 }, { "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 }, { "GL_ARB_shader_texture_lod", o(ARB_shader_texture_lod), GL, 2009 }, @@ -304,6 +305,7 @@ static const struct extension extension_table[] = { { "GL_AMD_performance_monitor", o(AMD_performance_monitor), GL, 2007 }, { "GL_AMD_seamless_cubemap_per_texture", o(AMD_seamless_cubemap_per_texture), GL, 2009 }, { "GL_AMD_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 }, + { "GL_AMD_shader_trinary_minmax", o(dummy_true), GL, 2012 }, { "GL_AMD_vertex_shader_layer", o(AMD_vertex_shader_layer), GLC, 2012 }, { "GL_APPLE_object_purgeable", o(APPLE_object_purgeable), GL, 2006 }, { "GL_APPLE_packed_pixels", o(dummy_true), GLL, 2002 }, @@ -396,10 +398,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; ctx->Extensions.ARB_fragment_shader = GL_TRUE; ctx->Extensions.ARB_framebuffer_object = GL_TRUE; - /* XXX re-enable when GLSL compiler again supports geometry shaders */ -#if 0 - ctx->Extensions.ARB_geometry_shader4 = GL_TRUE; -#endif ctx->Extensions.ARB_half_float_pixel = GL_TRUE; ctx->Extensions.ARB_half_float_vertex = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 2892784f8..dc7184ad4 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -877,8 +877,11 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, GLint fixedSampleLocations = -1; GLint i; GLuint j; - bool layer_count_valid = false; - GLuint layer_count = 0, att_layer_count; + /* Covers max_layer_count, is_layered, and layer_tex_target */ + bool layer_info_valid = false; + GLuint max_layer_count = 0, att_layer_count; + bool is_layered; + GLenum layer_tex_target = 0; assert(_mesa_is_user_fbo(fb)); @@ -1062,22 +1065,25 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, } else { att_layer_count = 0; } - if (!layer_count_valid) { - layer_count = att_layer_count; - layer_count_valid = true; - } else if (layer_count != att_layer_count) { - if (layer_count == 0 || att_layer_count == 0) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS; - fbo_incomplete(ctx, "framebuffer attachment layer mode is inconsistent", i); - } else { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB; - fbo_incomplete(ctx, "framebuffer attachment layer count is inconsistent", i); - } + if (!layer_info_valid) { + is_layered = att->Layered; + max_layer_count = att_layer_count; + layer_tex_target = att_tex_target; + layer_info_valid = true; + } else if (max_layer_count > 0 && layer_tex_target != att_tex_target) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS; + fbo_incomplete(ctx, "layered framebuffer has mismatched targets", i); + return; + } else if (is_layered != att->Layered) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS; + fbo_incomplete(ctx, "framebuffer attachment layer mode is inconsistent", i); return; + } else if (att_layer_count > max_layer_count) { + max_layer_count = att_layer_count; } } - fb->NumLayers = layer_count; + fb->MaxNumLayers = max_layer_count; if (_mesa_is_desktop_gl(ctx) && !ctx->Extensions.ARB_ES2_compatibility) { /* Check that all DrawBuffers are present */ @@ -1504,6 +1510,22 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm && ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0; + case GL_LUMINANCE_SNORM: + case GL_LUMINANCE8_SNORM: + case GL_LUMINANCE16_SNORM: + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_snorm + ? GL_LUMINANCE : 0; + case GL_LUMINANCE_ALPHA_SNORM: + case GL_LUMINANCE8_ALPHA8_SNORM: + case GL_LUMINANCE16_ALPHA16_SNORM: + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_snorm + ? GL_LUMINANCE_ALPHA : 0; + case GL_INTENSITY_SNORM: + case GL_INTENSITY8_SNORM: + case GL_INTENSITY16_SNORM: + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_snorm + ? GL_INTENSITY : 0; + case GL_R16F: case GL_R32F: return ((_mesa_is_desktop_gl(ctx) && diff --git a/mesalib/src/mesa/main/ff_fragment_shader.cpp b/mesalib/src/mesa/main/ff_fragment_shader.cpp index ba6258d89..00ca02558 100644 --- a/mesalib/src/mesa/main/ff_fragment_shader.cpp +++ b/mesalib/src/mesa/main/ff_fragment_shader.cpp @@ -1296,7 +1296,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key) p.mem_ctx = ralloc_context(NULL); p.shader = ctx->Driver.NewShader(ctx, 0, GL_FRAGMENT_SHADER); p.shader->ir = new(p.shader) exec_list; - state = new(p.shader) _mesa_glsl_parse_state(ctx, GL_FRAGMENT_SHADER, + state = new(p.shader) _mesa_glsl_parse_state(ctx, MESA_SHADER_FRAGMENT, p.shader); p.shader->symbols = state->symbols; p.top_instructions = p.shader->ir; diff --git a/mesalib/src/mesa/main/ffvertex_prog.c b/mesalib/src/mesa/main/ffvertex_prog.c index 074fbf9a3..808ea9cbd 100644 --- a/mesalib/src/mesa/main/ffvertex_prog.c +++ b/mesalib/src/mesa/main/ffvertex_prog.c @@ -1677,7 +1677,7 @@ _mesa_get_fixed_func_vertex_program(struct gl_context *ctx) create_new_program( &key, prog, ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].PreferDP4, - ctx->Const.VertexProgram.MaxTemps ); + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps ); #if 0 if (ctx->Driver.ProgramStringNotify) diff --git a/mesalib/src/mesa/main/format_pack.c b/mesalib/src/mesa/main/format_pack.c index 826fc10a6..41f5f99c1 100644 --- a/mesalib/src/mesa/main/format_pack.c +++ b/mesalib/src/mesa/main/format_pack.c @@ -1824,6 +1824,56 @@ pack_float_XBGR32323232_FLOAT(const GLfloat src[4], void *dst) d[3] = 1.0; } +/* MESA_FORMAT_ABGR2101010 */ + +static void +pack_ubyte_ABGR2101010(const GLubyte src[4], void *dst) +{ + GLuint *d = ((GLuint *) dst); + GLushort r = UBYTE_TO_USHORT(src[RCOMP]); + GLushort g = UBYTE_TO_USHORT(src[GCOMP]); + GLushort b = UBYTE_TO_USHORT(src[BCOMP]); + GLushort a = UBYTE_TO_USHORT(src[ACOMP]); + *d = PACK_COLOR_2101010_US(a, b, g, r); +} + +static void +pack_float_ABGR2101010(const GLfloat src[4], void *dst) +{ + GLuint *d = ((GLuint *) dst); + GLushort r, g, b, a; + UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(a, src[ACOMP]); + *d = PACK_COLOR_2101010_US(a, b, g, r); +} + +/* + * MESA_FORMAT_SIGNED_RG88 + */ + +static void +pack_float_SIGNED_RG88(const GLfloat src[4], void *dst) +{ + GLushort *d = (GLushort *) dst; + GLbyte r = FLOAT_TO_BYTE(CLAMP(src[RCOMP], -1.0f, 1.0f)); + GLbyte g = FLOAT_TO_BYTE(CLAMP(src[GCOMP], -1.0f, 1.0f)); + *d = (r << 8) | (g & 0xff); +} + +/* + * MESA_FORMAT_SIGNED_RG1616 + */ + +static void +pack_float_SIGNED_RG1616(const GLfloat src[4], void *dst) +{ + GLuint *d = (GLuint *) dst; + GLshort r = FLOAT_TO_SHORT(CLAMP(src[RCOMP], -1.0f, 1.0f)); + GLshort g = FLOAT_TO_SHORT(CLAMP(src[GCOMP], -1.0f, 1.0f)); + *d = (r << 16) | (g & 0xffff); +} /** * Return a function that can pack a GLubyte rgba[4] color. @@ -1978,6 +2028,8 @@ _mesa_get_pack_ubyte_rgba_function(gl_format format) table[MESA_FORMAT_XBGR32323232_UINT] = NULL; table[MESA_FORMAT_XBGR32323232_SINT] = NULL; + table[MESA_FORMAT_ABGR2101010] = pack_ubyte_ABGR2101010; + initialized = GL_TRUE; } @@ -2136,6 +2188,11 @@ _mesa_get_pack_float_rgba_function(gl_format format) table[MESA_FORMAT_XBGR32323232_UINT] = NULL; table[MESA_FORMAT_XBGR32323232_SINT] = NULL; + table[MESA_FORMAT_ABGR2101010] = pack_float_ABGR2101010; + + table[MESA_FORMAT_SIGNED_RG88] = pack_float_SIGNED_RG88; + table[MESA_FORMAT_SIGNED_RG1616] = pack_float_SIGNED_RG1616; + initialized = GL_TRUE; } diff --git a/mesalib/src/mesa/main/format_unpack.c b/mesalib/src/mesa/main/format_unpack.c index 0a8b8b183..28a50f31e 100644 --- a/mesalib/src/mesa/main/format_unpack.c +++ b/mesalib/src/mesa/main/format_unpack.c @@ -2268,6 +2268,44 @@ unpack_XBGR32323232_SINT(const void *src, GLfloat dst[][4], GLuint n) } } +static void +unpack_ABGR2101010(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = ((const GLuint *) src); + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = ((s[i] >> 0) & 0x3ff) * (1.0F / 1023.0F); + dst[i][GCOMP] = ((s[i] >> 10) & 0x3ff) * (1.0F / 1023.0F); + dst[i][BCOMP] = ((s[i] >> 20) & 0x3ff) * (1.0F / 1023.0F); + dst[i][ACOMP] = ((s[i] >> 30) & 0x03) * (1.0F / 3.0F); + } +} + +static void +unpack_SIGNED_RG88(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLushort *s = ((const GLushort *) src); + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 8) ); + dst[i][GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] & 0xff) ); + dst[i][BCOMP] = 0.0F; + dst[i][ACOMP] = 1.0F; + } +} + +static void +unpack_SIGNED_RG1616(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = ((const GLuint *) src); + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = SHORT_TO_FLOAT_TEX( (GLshort) (s[i] >> 16) ); + dst[i][GCOMP] = SHORT_TO_FLOAT_TEX( (GLshort) (s[i] & 0xffff) ); + dst[i][BCOMP] = 0.0F; + dst[i][ACOMP] = 1.0F; + } +} /** * Return the unpacker function for the given format. @@ -2481,6 +2519,11 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_XBGR32323232_UINT] = unpack_XBGR32323232_UINT; table[MESA_FORMAT_XBGR32323232_SINT] = unpack_XBGR32323232_SINT; + table[MESA_FORMAT_ABGR2101010] = unpack_ABGR2101010; + + table[MESA_FORMAT_SIGNED_RG88] = unpack_SIGNED_RG88; + table[MESA_FORMAT_SIGNED_RG1616] = unpack_SIGNED_RG1616; + initialized = GL_TRUE; } @@ -3582,6 +3625,20 @@ unpack_int_rgba_XBGR32323232_UINT(const GLuint *src, GLuint dst[][4], GLuint n) } } +static void +unpack_int_rgba_ABGR2101010(const GLuint *src, GLuint dst[][4], GLuint n) +{ + unsigned int i; + + for (i = 0; i < n; i++) { + GLuint tmp = src[i]; + dst[i][0] = (tmp >> 0) & 0x3ff; + dst[i][1] = (tmp >> 10) & 0x3ff; + dst[i][2] = (tmp >> 20) & 0x3ff; + dst[i][3] = (tmp >> 30) & 0x3; + } +} + void _mesa_unpack_uint_rgba_row(gl_format format, GLuint n, const void *src, GLuint dst[][4]) @@ -3782,6 +3839,10 @@ _mesa_unpack_uint_rgba_row(gl_format format, GLuint n, unpack_int_rgba_XBGR32323232_UINT(src, dst, n); break; + case MESA_FORMAT_ABGR2101010: + unpack_int_rgba_ABGR2101010(src, dst, n); + break; + default: _mesa_problem(NULL, "%s: bad format %s", __FUNCTION__, _mesa_get_format_name(format)); diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c index 07d2a7240..1246c4d92 100644 --- a/mesalib/src/mesa/main/formats.c +++ b/mesalib/src/mesa/main/formats.c @@ -1763,6 +1763,33 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 1, 1, 16 }, + { + MESA_FORMAT_ABGR2101010, + "MESA_FORMAT_ABGR2101010", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 10, 10, 10, 2, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_SIGNED_RG88, + "MESA_FORMAT_SIGNED_RG88", + GL_RG, + GL_SIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_SIGNED_RG1616, + "MESA_FORMAT_SIGNED_RG1616", + GL_RG, + GL_SIGNED_NORMALIZED, + 16, 16, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, }; @@ -1967,6 +1994,26 @@ _mesa_is_format_unsigned(gl_format format) /** + * Does the given format store signed values? + */ +GLboolean +_mesa_is_format_signed(gl_format format) +{ + if (format == MESA_FORMAT_R11_G11_B10_FLOAT || + format == MESA_FORMAT_RGB9_E5_FLOAT) { + /* these packed float formats only store unsigned values */ + return GL_FALSE; + } + else { + const struct gl_format_info *info = _mesa_get_format_info(format); + return (info->DataType == GL_SIGNED_NORMALIZED || + info->DataType == GL_INT || + info->DataType == GL_FLOAT); + } +} + + +/** * Return color encoding for given format. * \return GL_LINEAR or GL_SRGB */ @@ -2821,6 +2868,21 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; + case MESA_FORMAT_ABGR2101010: + *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; + *comps = 4; + return; + + case MESA_FORMAT_SIGNED_RG88: + *datatype = GL_BYTE; + *comps = 2; + return; + + case MESA_FORMAT_SIGNED_RG1616: + *datatype = GL_SHORT; + *comps = 2; + return; + case MESA_FORMAT_COUNT: assert(0); return; @@ -3362,6 +3424,18 @@ _mesa_format_matches_format_and_type(gl_format gl_format, case MESA_FORMAT_XBGR32323232_UINT: case MESA_FORMAT_XBGR32323232_SINT: return GL_FALSE; + + case MESA_FORMAT_ABGR2101010: + return format == GL_RGBA && type == GL_UNSIGNED_INT_2_10_10_10_REV && + !swapBytes; + + case MESA_FORMAT_SIGNED_RG88: + return format == GL_RG && type == GL_BYTE && !littleEndian && + !swapBytes; + + case MESA_FORMAT_SIGNED_RG1616: + return format == GL_RG && type == GL_SHORT && !littleEndian && + !swapBytes; } return GL_FALSE; diff --git a/mesalib/src/mesa/main/formats.h b/mesalib/src/mesa/main/formats.h index 64b4b9a01..a1f0d226a 100644 --- a/mesalib/src/mesa/main/formats.h +++ b/mesalib/src/mesa/main/formats.h @@ -304,6 +304,11 @@ typedef enum MESA_FORMAT_XBGR32323232_UINT, /* ... */ MESA_FORMAT_XBGR32323232_SINT, /* ... */ + MESA_FORMAT_ABGR2101010, + + MESA_FORMAT_SIGNED_RG88, + MESA_FORMAT_SIGNED_RG1616, + MESA_FORMAT_COUNT } gl_format; @@ -341,6 +346,9 @@ _mesa_is_format_integer_color(gl_format format); extern GLboolean _mesa_is_format_unsigned(gl_format format); +extern GLboolean +_mesa_is_format_signed(gl_format format); + extern GLenum _mesa_get_format_color_encoding(gl_format format); diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 691380898..b13f9a3db 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -145,6 +145,7 @@ enum value_extra { EXTRA_GLSL_130, EXTRA_EXT_UBO_GS4, EXTRA_EXT_ATOMICS_GS4, + EXTRA_EXT_SHADER_IMAGE_GS4, }; #define NO_EXTRA NULL @@ -327,6 +328,12 @@ static const int extra_EXT_framebuffer_sRGB_and_new_buffers[] = { EXTRA_END }; +static const int extra_EXT_packed_float[] = { + EXT(EXT_packed_float), + EXTRA_NEW_BUFFERS, + EXTRA_END +}; + static const int extra_EXT_texture_array_es3[] = { EXT(EXT_texture_array), EXTRA_API_ES3, @@ -338,6 +345,11 @@ static const int extra_ARB_shader_atomic_counters_and_geometry_shader[] = { EXTRA_END }; +static const int extra_ARB_shader_image_load_store_and_geometry_shader[] = { + EXTRA_EXT_SHADER_IMAGE_GS4, + EXTRA_END +}; + EXTRA_EXT(ARB_texture_cube_map); EXTRA_EXT(EXT_texture_array); EXTRA_EXT(NV_fog_distance); @@ -376,6 +388,7 @@ EXTRA_EXT(ARB_texture_multisample); EXTRA_EXT(ARB_texture_gather); EXTRA_EXT(ARB_shader_atomic_counters); EXTRA_EXT(ARB_draw_indirect); +EXTRA_EXT(ARB_shader_image_load_store); static const int extra_ARB_color_buffer_float_or_glcore[] = { @@ -757,6 +770,45 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu ctx->Texture.Unit[unit].CurrentTex[d->offset]->Name; break; + /* GL_EXT_packed_float */ + case GL_RGBA_SIGNED_COMPONENTS_EXT: + { + /* Note: we only check the 0th color attachment. */ + const struct gl_renderbuffer *rb = + ctx->DrawBuffer->_ColorDrawBuffers[0]; + if (rb && _mesa_is_format_signed(rb->Format)) { + /* Issue 17 of GL_EXT_packed_float: If a component (such as + * alpha) has zero bits, the component should not be considered + * signed and so the bit for the respective component should be + * zeroed. + */ + GLint r_bits = + _mesa_get_format_bits(rb->Format, GL_RED_BITS); + GLint g_bits = + _mesa_get_format_bits(rb->Format, GL_GREEN_BITS); + GLint b_bits = + _mesa_get_format_bits(rb->Format, GL_BLUE_BITS); + GLint a_bits = + _mesa_get_format_bits(rb->Format, GL_ALPHA_BITS); + GLint l_bits = + _mesa_get_format_bits(rb->Format, GL_TEXTURE_LUMINANCE_SIZE); + GLint i_bits = + _mesa_get_format_bits(rb->Format, GL_TEXTURE_INTENSITY_SIZE); + + v->value_int_4[0] = r_bits + l_bits + i_bits > 0; + v->value_int_4[1] = g_bits + l_bits + i_bits > 0; + v->value_int_4[2] = b_bits + l_bits + i_bits > 0; + v->value_int_4[3] = a_bits + i_bits > 0; + } + else { + v->value_int_4[0] = + v->value_int_4[1] = + v->value_int_4[2] = + v->value_int_4[3] = 0; + } + } + break; + /* GL_ARB_vertex_buffer_object */ case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: @@ -849,11 +901,11 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_float = ctx->Color.AlphaRefUnclamped; break; case GL_MAX_VERTEX_UNIFORM_VECTORS: - v->value_int = ctx->Const.VertexProgram.MaxUniformComponents / 4; + v->value_int = ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4; break; case GL_MAX_FRAGMENT_UNIFORM_VECTORS: - v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4; + v->value_int = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4; break; /* GL_ARB_texture_buffer_object */ @@ -1026,6 +1078,11 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d api_found = (ctx->Extensions.ARB_shader_atomic_counters && _mesa_has_geometry_shaders(ctx)); break; + case EXTRA_EXT_SHADER_IMAGE_GS4: + api_check = GL_TRUE; + api_found = (ctx->Extensions.ARB_shader_image_load_store && + _mesa_has_geometry_shaders(ctx)); + break; case EXTRA_END: break; default: /* *e is a offset into the extension struct */ @@ -1747,7 +1804,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) case GL_VERTEX_BINDING_DIVISOR: if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_instanced_arrays) goto invalid_enum; - if (index >= ctx->Const.VertexProgram.MaxAttribs) + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) goto invalid_value; v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].InstanceDivisor; return TYPE_INT; @@ -1755,7 +1812,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) case GL_VERTEX_BINDING_OFFSET: if (!_mesa_is_desktop_gl(ctx)) goto invalid_enum; - if (index >= ctx->Const.VertexProgram.MaxAttribs) + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) goto invalid_value; v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Offset; return TYPE_INT; @@ -1763,9 +1820,67 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) case GL_VERTEX_BINDING_STRIDE: if (!_mesa_is_desktop_gl(ctx)) goto invalid_enum; - if (index >= ctx->Const.VertexProgram.MaxAttribs) + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) goto invalid_value; v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride; + + /* ARB_shader_image_load_store */ + case GL_IMAGE_BINDING_NAME: { + struct gl_texture_object *t; + + if (!ctx->Extensions.ARB_shader_image_load_store) + goto invalid_enum; + if (index >= ctx->Const.MaxImageUnits) + goto invalid_value; + + t = ctx->ImageUnits[index].TexObj; + v->value_int = (t ? t->Name : 0); + return TYPE_INT; + } + + case GL_IMAGE_BINDING_LEVEL: + if (!ctx->Extensions.ARB_shader_image_load_store) + goto invalid_enum; + if (index >= ctx->Const.MaxImageUnits) + goto invalid_value; + + v->value_int = ctx->ImageUnits[index].Level; + return TYPE_INT; + + case GL_IMAGE_BINDING_LAYERED: + if (!ctx->Extensions.ARB_shader_image_load_store) + goto invalid_enum; + if (index >= ctx->Const.MaxImageUnits) + goto invalid_value; + + v->value_int = ctx->ImageUnits[index].Layered; + return TYPE_INT; + + case GL_IMAGE_BINDING_LAYER: + if (!ctx->Extensions.ARB_shader_image_load_store) + goto invalid_enum; + if (index >= ctx->Const.MaxImageUnits) + goto invalid_value; + + v->value_int = ctx->ImageUnits[index].Layer; + return TYPE_INT; + + case GL_IMAGE_BINDING_ACCESS: + if (!ctx->Extensions.ARB_shader_image_load_store) + goto invalid_enum; + if (index >= ctx->Const.MaxImageUnits) + goto invalid_value; + + v->value_int = ctx->ImageUnits[index].Access; + return TYPE_INT; + + case GL_IMAGE_BINDING_FORMAT: + if (!ctx->Extensions.ARB_shader_image_load_store) + goto invalid_enum; + if (index >= ctx->Const.MaxImageUnits) + goto invalid_value; + + v->value_int = ctx->ImageUnits[index].Format; return TYPE_INT; } diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py index 653bf6256..6195d630d 100644 --- a/mesalib/src/mesa/main/get_hash_params.py +++ b/mesalib/src/mesa/main/get_hash_params.py @@ -271,8 +271,8 @@ descriptor=[ # GL_ARB_fragment_program # == GL_MAX_TEXTURE_IMAGE_UNITS_NV - [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.FragmentProgram.MaxTextureImageUnits), extra_ARB_fragment_program" ], - [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxTextureImageUnits), extra_ARB_vertex_shader" ], + [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits), extra_ARB_fragment_program" ], + [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits), extra_ARB_vertex_shader" ], [ "MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxCombinedTextureImageUnits), extra_ARB_vertex_shader" ], # GL_ARB_shader_objects @@ -288,7 +288,7 @@ descriptor=[ [ "STENCIL_BACK_FAIL", "CONTEXT_ENUM(Stencil.FailFunc[1]), NO_EXTRA" ], [ "STENCIL_BACK_PASS_DEPTH_FAIL", "CONTEXT_ENUM(Stencil.ZFailFunc[1]), NO_EXTRA" ], [ "STENCIL_BACK_PASS_DEPTH_PASS", "CONTEXT_ENUM(Stencil.ZPassFunc[1]), NO_EXTRA" ], - [ "MAX_VERTEX_ATTRIBS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxAttribs), extra_ARB_vertex_program_api_es2" ], + [ "MAX_VERTEX_ATTRIBS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAttribs), extra_ARB_vertex_program_api_es2" ], # OES_texture_3D [ "TEXTURE_BINDING_3D", "LOC_CUSTOM, TYPE_INT, TEXTURE_3D_INDEX, NO_EXTRA" ], @@ -328,14 +328,14 @@ descriptor=[ [ "MINOR_VERSION", "LOC_CUSTOM, TYPE_INT, 0, extra_gl30_es3" ], # GL 3.2 / GLES3 - [ "MAX_VERTEX_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.VertexProgram.MaxOutputComponents), extra_gl32_es3" ], - [ "MAX_FRAGMENT_INPUT_COMPONENTS", "CONTEXT_INT(Const.FragmentProgram.MaxInputComponents), extra_gl32_es3" ], + [ "MAX_VERTEX_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents), extra_gl32_es3" ], + [ "MAX_FRAGMENT_INPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents), extra_gl32_es3" ], # GL_ARB_ES3_compatibility [ "MAX_ELEMENT_INDEX", "CONTEXT_INT64(Const.MaxElementIndex), extra_ARB_ES3_compatibility_api_es3"], # GL_ARB_fragment_shader - [ "MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.FragmentProgram.MaxUniformComponents), extra_ARB_fragment_shader" ], + [ "MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents), extra_ARB_fragment_shader" ], # GL_ARB_framebuffer_object [ "MAX_SAMPLES", "CONTEXT_INT(Const.MaxSamples), extra_ARB_framebuffer_object_EXT_framebuffer_multisample" ], @@ -349,18 +349,18 @@ descriptor=[ [ "TRANSFORM_FEEDBACK_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_transform_feedback2_api_es3" ], # GL_ARB_uniform_buffer_object - [ "MAX_VERTEX_UNIFORM_BLOCKS", "CONTEXT_INT(Const.VertexProgram.MaxUniformBlocks), extra_ARB_uniform_buffer_object" ], - [ "MAX_FRAGMENT_UNIFORM_BLOCKS", "CONTEXT_INT(Const.FragmentProgram.MaxUniformBlocks), extra_ARB_uniform_buffer_object" ], + [ "MAX_VERTEX_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxUniformBlocks), extra_ARB_uniform_buffer_object" ], + [ "MAX_FRAGMENT_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxUniformBlocks), extra_ARB_uniform_buffer_object" ], [ "MAX_COMBINED_UNIFORM_BLOCKS", "CONTEXT_INT(Const.MaxCombinedUniformBlocks), extra_ARB_uniform_buffer_object" ], [ "MAX_UNIFORM_BLOCK_SIZE", "CONTEXT_INT(Const.MaxUniformBlockSize), extra_ARB_uniform_buffer_object" ], [ "MAX_UNIFORM_BUFFER_BINDINGS", "CONTEXT_INT(Const.MaxUniformBufferBindings), extra_ARB_uniform_buffer_object" ], - [ "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.VertexProgram.MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object" ], - [ "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.FragmentProgram.MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object" ], + [ "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object" ], + [ "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object" ], [ "UNIFORM_BUFFER_OFFSET_ALIGNMENT", "CONTEXT_INT(Const.UniformBufferOffsetAlignment), extra_ARB_uniform_buffer_object" ], [ "UNIFORM_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_uniform_buffer_object" ], # GL_ARB_vertex_shader - [ "MAX_VERTEX_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxUniformComponents), extra_ARB_vertex_shader" ], + [ "MAX_VERTEX_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents), extra_ARB_vertex_shader" ], [ "MAX_VARYING_FLOATS_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_vertex_shader" ], # GL_EXT_framebuffer_blit @@ -611,6 +611,9 @@ descriptor=[ # GL_ARB_fragment_program [ "FRAGMENT_PROGRAM_ARB", "CONTEXT_BOOL(FragmentProgram.Enabled), extra_ARB_fragment_program" ], +# GL_EXT_packed_float + [ "RGBA_SIGNED_COMPONENTS_EXT", "LOC_CUSTOM, TYPE_INT_4, 0, extra_EXT_packed_float" ], + # GL_EXT_depth_bounds_test [ "DEPTH_BOUNDS_TEST_EXT", "CONTEXT_BOOL(Depth.BoundsTest), extra_EXT_depth_bounds_test" ], [ "DEPTH_BOUNDS_EXT", "CONTEXT_FLOAT2(Depth.BoundsMin), extra_EXT_depth_bounds_test" ], @@ -643,12 +646,12 @@ descriptor=[ [ "MAX_VERTEX_STREAMS", "CONTEXT_INT(Const.MaxVertexStreams), extra_ARB_transform_feedback3" ], # GL_ARB_geometry_shader4 - [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxTextureImageUnits), extra_gl32_ARB_geometry_shader4" ], + [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits), extra_gl32_ARB_geometry_shader4" ], [ "MAX_GEOMETRY_OUTPUT_VERTICES_ARB", "CONTEXT_INT(Const.MaxGeometryOutputVertices), extra_gl32_ARB_geometry_shader4" ], [ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxGeometryTotalOutputComponents), extra_gl32_ARB_geometry_shader4" ], - [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxUniformComponents), extra_gl32_ARB_geometry_shader4" ], - [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxOutputComponents), extra_ARB_geometry_shader4" ], - [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxOutputComponents), extra_ARB_geometry_shader4" ], + [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents), extra_gl32_ARB_geometry_shader4" ], + [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents), extra_ARB_geometry_shader4" ], + [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents), extra_ARB_geometry_shader4" ], # GL_ARB_color_buffer_float [ "RGBA_FLOAT_MODE_ARB", "BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), extra_core_ARB_color_buffer_float_and_new_buffers" ], @@ -688,8 +691,8 @@ descriptor=[ # GL 3.2 [ "CONTEXT_PROFILE_MASK", "CONTEXT_INT(Const.ProfileMask), extra_version_32" ], - [ "MAX_GEOMETRY_INPUT_COMPONENTS", "CONTEXT_INT(Const.GeometryProgram.MaxInputComponents), extra_version_32" ], - [ "MAX_GEOMETRY_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.GeometryProgram.MaxOutputComponents), extra_version_32" ], + [ "MAX_GEOMETRY_INPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents), extra_version_32" ], + [ "MAX_GEOMETRY_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents), extra_version_32" ], # GL_ARB_robustness [ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA" ], @@ -706,8 +709,8 @@ descriptor=[ [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", "CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ], # GL_ARB_uniform_buffer_object - [ "MAX_GEOMETRY_UNIFORM_BLOCKS", "CONTEXT_INT(Const.GeometryProgram.MaxUniformBlocks), extra_ARB_uniform_buffer_object_and_geometry_shader" ], - [ "MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.GeometryProgram.MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object_and_geometry_shader" ], + [ "MAX_GEOMETRY_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), extra_ARB_uniform_buffer_object_and_geometry_shader" ], + [ "MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object_and_geometry_shader" ], # GL_ARB_timer_query [ "TIMESTAMP", "LOC_CUSTOM, TYPE_INT64, 0, extra_ARB_timer_query" ], @@ -727,18 +730,27 @@ descriptor=[ [ "ATOMIC_COUNTER_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_shader_atomic_counters" ], [ "MAX_ATOMIC_COUNTER_BUFFER_BINDINGS", "CONTEXT_INT(Const.MaxAtomicBufferBindings), extra_ARB_shader_atomic_counters" ], [ "MAX_ATOMIC_COUNTER_BUFFER_SIZE", "CONTEXT_INT(Const.MaxAtomicBufferSize), extra_ARB_shader_atomic_counters" ], - [ "MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.VertexProgram.MaxAtomicBuffers), extra_ARB_shader_atomic_counters" ], - [ "MAX_VERTEX_ATOMIC_COUNTERS", "CONTEXT_INT(Const.VertexProgram.MaxAtomicCounters), extra_ARB_shader_atomic_counters" ], - [ "MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.FragmentProgram.MaxAtomicBuffers), extra_ARB_shader_atomic_counters" ], - [ "MAX_FRAGMENT_ATOMIC_COUNTERS", "CONTEXT_INT(Const.FragmentProgram.MaxAtomicCounters), extra_ARB_shader_atomic_counters" ], - [ "MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.GeometryProgram.MaxAtomicBuffers), extra_ARB_shader_atomic_counters_and_geometry_shader" ], - [ "MAX_GEOMETRY_ATOMIC_COUNTERS", "CONTEXT_INT(Const.GeometryProgram.MaxAtomicCounters), extra_ARB_shader_atomic_counters_and_geometry_shader" ], + [ "MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers), extra_ARB_shader_atomic_counters" ], + [ "MAX_VERTEX_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters), extra_ARB_shader_atomic_counters" ], + [ "MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers), extra_ARB_shader_atomic_counters" ], + [ "MAX_FRAGMENT_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), extra_ARB_shader_atomic_counters" ], + [ "MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBuffers), extra_ARB_shader_atomic_counters_and_geometry_shader" ], + [ "MAX_GEOMETRY_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters), extra_ARB_shader_atomic_counters_and_geometry_shader" ], [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.MaxCombinedAtomicBuffers), extra_ARB_shader_atomic_counters" ], [ "MAX_COMBINED_ATOMIC_COUNTERS", "CONTEXT_INT(Const.MaxCombinedAtomicCounters), extra_ARB_shader_atomic_counters" ], # GL_ARB_vertex_attrib_binding [ "MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", "CONTEXT_ENUM(Const.MaxVertexAttribRelativeOffset), NO_EXTRA" ], [ "MAX_VERTEX_ATTRIB_BINDINGS", "CONTEXT_ENUM(Const.MaxVertexAttribBindings), NO_EXTRA" ], + +# GL_ARB_shader_image_load_store + [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), extra_ARB_shader_image_load_store"], + [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", "CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), extra_ARB_shader_image_load_store"], + [ "MAX_IMAGE_SAMPLES", "CONTEXT_INT(Const.MaxImageSamples), extra_ARB_shader_image_load_store"], + [ "MAX_VERTEX_IMAGE_UNIFORMS", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), extra_ARB_shader_image_load_store"], + [ "MAX_GEOMETRY_IMAGE_UNIFORMS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxImageUniforms), extra_ARB_shader_image_load_store_and_geometry_shader"], + [ "MAX_FRAGMENT_IMAGE_UNIFORMS", "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), extra_ARB_shader_image_load_store"], + [ "MAX_COMBINED_IMAGE_UNIFORMS", "CONTEXT_INT(Const.MaxCombinedImageUniforms), extra_ARB_shader_image_load_store"], ]}, # Enums restricted to OpenGL Core profile diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index f93bb5641..33df682cf 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -393,6 +393,23 @@ typedef enum /** + * Shader stages. Note that these will become 5 with tessellation. + * + * The order must match how shaders are ordered in the pipeline. + * The GLSL linker assumes that if i<j, then the j-th shader is + * executed later than the i-th shader. + */ +typedef enum +{ + MESA_SHADER_VERTEX = 0, + MESA_SHADER_GEOMETRY = 1, + MESA_SHADER_FRAGMENT = 2, +} gl_shader_stage; + +#define MESA_SHADER_STAGES (MESA_SHADER_FRAGMENT + 1) + + +/** * Framebuffer configuration (aka visual / pixelformat) * Note: some of these fields should be boolean, but it appears that * code in drivers/dri/common/util.c requires int-sized fields. @@ -1213,6 +1230,9 @@ struct gl_texture_object /** GL_OES_EGL_image_external */ GLint RequiredTextureImageUnits; + + /** GL_ARB_shader_image_load_store */ + GLenum ImageFormatCompatibilityType; }; @@ -2302,6 +2322,7 @@ struct gl_shader * Must be the first field. */ GLenum Type; + gl_shader_stage Stage; GLuint Name; /**< AKA the handle */ GLchar *Label; /**< GL_KHR_debug */ GLint RefCount; /**< Reference count */ @@ -2384,24 +2405,33 @@ struct gl_shader */ GLenum OutputType; } Geom; -}; + /** + * Map from image uniform index to image unit (set by glUniform1i()) + * + * An image uniform index is associated with each image uniform by + * the linker. The image index associated with each uniform is + * stored in the \c gl_uniform_storage::image field. + */ + GLubyte ImageUnits[MAX_IMAGE_UNIFORMS]; -/** - * Shader stages. Note that these will become 5 with tessellation. - * - * The order must match how shaders are ordered in the pipeline. - * The GLSL linker assumes that if i<j, then the j-th shader is - * executed later than the i-th shader. - */ -typedef enum -{ - MESA_SHADER_VERTEX = 0, - MESA_SHADER_GEOMETRY = 1, - MESA_SHADER_FRAGMENT = 2, -} gl_shader_type; + /** + * Access qualifier specified in the shader for each image uniform + * index. Either \c GL_READ_ONLY, \c GL_WRITE_ONLY or \c + * GL_READ_WRITE. + * + * It may be different, though only more strict than the value of + * \c gl_image_unit::Access for the corresponding image unit. + */ + GLenum ImageAccess[MAX_IMAGE_UNIFORMS]; -#define MESA_SHADER_TYPES (MESA_SHADER_FRAGMENT + 1) + /** + * Number of image uniforms defined in the shader. It specifies + * the number of valid elements in the \c ImageUnits and \c + * ImageAccess arrays above. + */ + GLuint NumImages; +}; struct gl_uniform_buffer_variable @@ -2482,7 +2512,7 @@ struct gl_active_atomic_buffer GLuint MinimumSize; /** Shader stages making use of it. */ - GLboolean StageReferences[MESA_SHADER_TYPES]; + GLboolean StageReferences[MESA_SHADER_STAGES]; }; /** @@ -2620,7 +2650,7 @@ struct gl_shader_program * This is used to maintain the Binding values of the stage's UniformBlocks[] * and to answer the GL_UNIFORM_BLOCK_REFERENCED_BY_*_SHADER queries. */ - int *UniformBlockStageIndex[MESA_SHADER_TYPES]; + int *UniformBlockStageIndex[MESA_SHADER_STAGES]; /** * Map of active uniform names to locations @@ -2650,7 +2680,7 @@ struct gl_shader_program * \c MESA_SHADER_* defines. Entries for non-existent stages will be * \c NULL. */ - struct gl_shader *_LinkedShaders[MESA_SHADER_TYPES]; + struct gl_shader *_LinkedShaders[MESA_SHADER_STAGES]; }; @@ -3007,12 +3037,11 @@ struct gl_framebuffer struct gl_renderbuffer *_ColorReadBuffer; /** - * The number of layers in the framebuffer, or 0 if the framebuffer is not - * layered. For cube maps, this value is 6. For cube map arrays, this - * value is the "depth" value passed to TexImage3D (always a multiple of - * 6). + * The maximum number of layers in the framebuffer, or 0 if the framebuffer + * is not layered. For cube maps and cube map arrays, each cube face + * counts as a layer. */ - GLuint NumLayers; + GLuint MaxNumLayers; /** Delete this framebuffer */ void (*Delete)(struct gl_framebuffer *fb); @@ -3089,9 +3118,13 @@ struct gl_program_constants GLuint MaxUniformBlocks; GLuint MaxCombinedUniformComponents; GLuint MaxTextureImageUnits; + /* GL_ARB_shader_atomic_counters */ GLuint MaxAtomicBuffers; GLuint MaxAtomicCounters; + + /* GL_ARB_shader_image_load_store */ + GLuint MaxImageUniforms; }; @@ -3134,9 +3167,7 @@ struct gl_constants GLuint MaxViewportWidth, MaxViewportHeight; - struct gl_program_constants VertexProgram; /**< GL_ARB_vertex_program */ - struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */ - struct gl_program_constants GeometryProgram; /**< GL_ARB_geometry_shader4 */ + struct gl_program_constants Program[MESA_SHADER_STAGES]; GLuint MaxProgramMatrices; GLuint MaxProgramMatrixStackDepth; @@ -3314,6 +3345,12 @@ struct gl_constants /** GL_ARB_vertex_attrib_binding */ GLint MaxVertexAttribRelativeOffset; GLint MaxVertexAttribBindings; + + /* GL_ARB_shader_image_load_store */ + GLuint MaxImageUnits; + GLuint MaxCombinedImageUnitsAndFragmentOutputs; + GLuint MaxImageSamples; + GLuint MaxCombinedImageUniforms; }; @@ -3361,6 +3398,7 @@ struct gl_extensions GLboolean ARB_seamless_cube_map; GLboolean ARB_shader_atomic_counters; GLboolean ARB_shader_bit_encoding; + GLboolean ARB_shader_image_load_store; GLboolean ARB_shader_stencil_export; GLboolean ARB_shader_texture_lod; GLboolean ARB_shading_language_packing; @@ -3435,6 +3473,7 @@ struct gl_extensions /* vendor extensions */ GLboolean AMD_performance_monitor; GLboolean AMD_seamless_cubemap_per_texture; + GLboolean AMD_shader_trinary_minmax; GLboolean AMD_vertex_shader_layer; GLboolean APPLE_object_purgeable; GLboolean ATI_envmap_bumpmap; @@ -3738,6 +3777,11 @@ struct gl_driver_flags * gl_context::AtomicBufferBindings */ GLbitfield NewAtomicBuffer; + + /** + * gl_context::ImageUnits + */ + GLbitfield NewImageUnits; }; struct gl_uniform_buffer_binding @@ -3755,6 +3799,60 @@ struct gl_uniform_buffer_binding }; /** + * ARB_shader_image_load_store image unit. + */ +struct gl_image_unit +{ + /** + * Texture object bound to this unit. + */ + struct gl_texture_object *TexObj; + + /** + * Level of the texture object bound to this unit. + */ + GLuint Level; + + /** + * \c GL_TRUE if the whole level is bound as an array of layers, \c + * GL_FALSE if only some specific layer of the texture is bound. + * \sa Layer + */ + GLboolean Layered; + + /** + * Layer of the texture object bound to this unit, or zero if the + * whole level is bound. + */ + GLuint Layer; + + /** + * Access allowed to this texture image. Either \c GL_READ_ONLY, + * \c GL_WRITE_ONLY or \c GL_READ_WRITE. + */ + GLenum Access; + + /** + * GL internal format that determines the interpretation of the + * image memory when shader image operations are performed through + * this unit. + */ + GLenum Format; + + /** + * Mesa format corresponding to \c Format. + */ + gl_format _ActualFormat; + + /** + * GL_TRUE if the state of this image unit is valid and access from + * the shader is allowed. Otherwise loads from this unit should + * return zero and stores should have no effect. + */ + GLboolean _Valid; +}; + +/** * Binding point for an atomic counter buffer object. */ struct gl_atomic_buffer_binding @@ -3906,7 +4004,7 @@ struct gl_context struct gl_ati_fragment_shader_state ATIFragmentShader; struct gl_shader_state Shader; /**< GLSL shader object state */ - struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_TYPES]; + struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_STAGES]; struct gl_query_state Query; /**< occlusion, timer queries */ @@ -3946,6 +4044,11 @@ struct gl_context struct gl_atomic_buffer_binding AtomicBufferBindings[MAX_COMBINED_ATOMIC_BUFFERS]; + /** + * Array of image units for ARB_shader_image_load_store. + */ + struct gl_image_unit ImageUnits[MAX_IMAGE_UNITS]; + /*@}*/ struct gl_meta_state *Meta; /**< for "meta" operations */ diff --git a/mesalib/src/mesa/main/scissor.c b/mesalib/src/mesa/main/scissor.c index 0eddaa6c1..ac86bd591 100644 --- a/mesalib/src/mesa/main/scissor.c +++ b/mesalib/src/mesa/main/scissor.c @@ -79,7 +79,7 @@ _mesa_set_scissor(struct gl_context *ctx, ctx->Scissor.Height = height; if (ctx->Driver.Scissor) - ctx->Driver.Scissor( ctx, x, y, width, height ); + ctx->Driver.Scissor(ctx); } diff --git a/mesalib/src/mesa/main/shader_query.cpp b/mesalib/src/mesa/main/shader_query.cpp index f14e1a562..e1afe5315 100644 --- a/mesalib/src/mesa/main/shader_query.cpp +++ b/mesalib/src/mesa/main/shader_query.cpp @@ -59,7 +59,7 @@ _mesa_BindAttribLocation(GLhandleARB program, GLuint index, return; } - if (index >= ctx->Const.VertexProgram.MaxAttribs) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocation(index)"); return; } diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 57511e83e..6042fa896 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -108,7 +108,7 @@ _mesa_init_shader_state(struct gl_context *ctx) * are generated by the GLSL compiler. */ struct gl_shader_compiler_options options; - gl_shader_type sh; + gl_shader_stage sh; memset(&options, 0, sizeof(options)); options.MaxUnrollIterations = 32; @@ -117,7 +117,7 @@ _mesa_init_shader_state(struct gl_context *ctx) /* Default pragma settings */ options.DefaultPragmas.Optimize = GL_TRUE; - for (sh = 0; sh < MESA_SHADER_TYPES; ++sh) + for (sh = 0; sh < MESA_SHADER_STAGES; ++sh) memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options)); ctx->Shader.Flags = get_shader_flags(); @@ -778,7 +778,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj) if (!sh) return; - options = &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(sh->Type)]; + options = &ctx->ShaderCompilerOptions[sh->Stage]; /* set default pragma state for shader */ sh->Pragmas = options->DefaultPragmas; @@ -791,7 +791,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj) } else { if (ctx->Shader.Flags & GLSL_DUMP) { printf("GLSL source for %s shader %d:\n", - _mesa_shader_enum_to_string(sh->Type), sh->Name); + _mesa_shader_stage_to_string(sh->Stage), sh->Name); printf("%s\n", sh->Source); } @@ -823,7 +823,7 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj) if (!sh->CompileStatus) { if (ctx->Shader.Flags & GLSL_DUMP_ON_ERROR) { fprintf(stderr, "GLSL source for %s shader %d:\n", - _mesa_shader_enum_to_string(sh->Type), sh->Name); + _mesa_shader_stage_to_string(sh->Stage), sh->Name); fprintf(stderr, "%s\n", sh->Source); fprintf(stderr, "Info Log:\n%s\n", sh->InfoLog); fflush(stderr); @@ -898,7 +898,7 @@ print_shader_info(const struct gl_shader_program *shProg) printf("Mesa: glUseProgram(%u)\n", shProg->Name); for (i = 0; i < shProg->NumShaders; i++) { printf(" %s shader %u, checksum %u\n", - _mesa_shader_enum_to_string(shProg->Shaders[i]->Type), + _mesa_shader_stage_to_string(shProg->Shaders[i]->Stage), shProg->Shaders[i]->Name, shProg->Shaders[i]->SourceChecksum); } @@ -1533,10 +1533,10 @@ _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, switch (shadertype) { case GL_VERTEX_SHADER: - limits = &ctx->Const.VertexProgram; + limits = &ctx->Const.Program[MESA_SHADER_VERTEX]; break; case GL_FRAGMENT_SHADER: - limits = &ctx->Const.FragmentProgram; + limits = &ctx->Const.Program[MESA_SHADER_FRAGMENT]; break; default: _mesa_error(ctx, GL_INVALID_ENUM, @@ -1836,7 +1836,7 @@ _mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string) * object to a specific gl_program object. */ void -_mesa_copy_linked_program_data(gl_shader_type type, +_mesa_copy_linked_program_data(gl_shader_stage type, const struct gl_shader_program *src, struct gl_program *dst) { diff --git a/mesalib/src/mesa/main/shaderapi.h b/mesalib/src/mesa/main/shaderapi.h index fe58e7de9..4822e32c2 100644 --- a/mesalib/src/mesa/main/shaderapi.h +++ b/mesalib/src/mesa/main/shaderapi.h @@ -211,7 +211,7 @@ extern GLuint GLAPIENTRY _mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string); extern void -_mesa_copy_linked_program_data(gl_shader_type type, +_mesa_copy_linked_program_data(gl_shader_stage type, const struct gl_shader_program *src, struct gl_program *dst); diff --git a/mesalib/src/mesa/main/shaderimage.c b/mesalib/src/mesa/main/shaderimage.c new file mode 100644 index 000000000..80c469366 --- /dev/null +++ b/mesalib/src/mesa/main/shaderimage.c @@ -0,0 +1,488 @@ +/* + * Copyright 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: + * Francisco Jerez <currojerez@riseup.net> + */ + +#include <assert.h> + +#include "shaderimage.h" +#include "mtypes.h" +#include "formats.h" +#include "errors.h" +#include "context.h" +#include "texobj.h" +#include "teximage.h" + +/* + * Define endian-invariant aliases for some mesa formats that are + * defined in terms of their channel layout from LSB to MSB in a + * 32-bit word. The actual byte offsets matter here because the user + * is allowed to bit-cast one format into another and get predictable + * results. + */ +#ifdef MESA_BIG_ENDIAN +# define MESA_FORMAT_RGBA_8 MESA_FORMAT_RGBA8888 +# define MESA_FORMAT_RG_16 MESA_FORMAT_RG1616 +# define MESA_FORMAT_RG_8 MESA_FORMAT_RG88 +# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_SIGNED_RGBA8888 +# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_SIGNED_RG1616 +# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88 +#else +# define MESA_FORMAT_RGBA_8 MESA_FORMAT_RGBA8888_REV +# define MESA_FORMAT_RG_16 MESA_FORMAT_GR1616 +# define MESA_FORMAT_RG_8 MESA_FORMAT_GR88 +# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_SIGNED_RGBA8888_REV +# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_SIGNED_GR1616 +# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88_REV +#endif + +static gl_format +get_image_format(GLenum format) +{ + switch (format) { + case GL_RGBA32F: + return MESA_FORMAT_RGBA_FLOAT32; + + case GL_RGBA16F: + return MESA_FORMAT_RGBA_FLOAT16; + + case GL_RG32F: + return MESA_FORMAT_RG_FLOAT32; + + case GL_RG16F: + return MESA_FORMAT_RG_FLOAT16; + + case GL_R11F_G11F_B10F: + return MESA_FORMAT_R11_G11_B10_FLOAT; + + case GL_R32F: + return MESA_FORMAT_R_FLOAT32; + + case GL_R16F: + return MESA_FORMAT_R_FLOAT16; + + case GL_RGBA32UI: + return MESA_FORMAT_RGBA_UINT32; + + case GL_RGBA16UI: + return MESA_FORMAT_RGBA_UINT16; + + case GL_RGB10_A2UI: + return MESA_FORMAT_ABGR2101010_UINT; + + case GL_RGBA8UI: + return MESA_FORMAT_RGBA_UINT8; + + case GL_RG32UI: + return MESA_FORMAT_RG_UINT32; + + case GL_RG16UI: + return MESA_FORMAT_RG_UINT16; + + case GL_RG8UI: + return MESA_FORMAT_RG_UINT8; + + case GL_R32UI: + return MESA_FORMAT_R_UINT32; + + case GL_R16UI: + return MESA_FORMAT_R_UINT16; + + case GL_R8UI: + return MESA_FORMAT_R_UINT8; + + case GL_RGBA32I: + return MESA_FORMAT_RGBA_INT32; + + case GL_RGBA16I: + return MESA_FORMAT_RGBA_INT16; + + case GL_RGBA8I: + return MESA_FORMAT_RGBA_INT8; + + case GL_RG32I: + return MESA_FORMAT_RG_INT32; + + case GL_RG16I: + return MESA_FORMAT_RG_INT16; + + case GL_RG8I: + return MESA_FORMAT_RG_INT8; + + case GL_R32I: + return MESA_FORMAT_R_INT32; + + case GL_R16I: + return MESA_FORMAT_R_INT16; + + case GL_R8I: + return MESA_FORMAT_R_INT8; + + case GL_RGBA16: + return MESA_FORMAT_RGBA_16; + + case GL_RGB10_A2: + return MESA_FORMAT_ABGR2101010; + + case GL_RGBA8: + return MESA_FORMAT_RGBA_8; + + case GL_RG16: + return MESA_FORMAT_RG_16; + + case GL_RG8: + return MESA_FORMAT_RG_8; + + case GL_R16: + return MESA_FORMAT_R16; + + case GL_R8: + return MESA_FORMAT_R8; + + case GL_RGBA16_SNORM: + return MESA_FORMAT_SIGNED_RGBA_16; + + case GL_RGBA8_SNORM: + return MESA_FORMAT_SIGNED_RGBA_8; + + case GL_RG16_SNORM: + return MESA_FORMAT_SIGNED_RG_16; + + case GL_RG8_SNORM: + return MESA_FORMAT_SIGNED_RG_8; + + case GL_R16_SNORM: + return MESA_FORMAT_SIGNED_R16; + + case GL_R8_SNORM: + return MESA_FORMAT_SIGNED_R8; + + default: + return MESA_FORMAT_NONE; + } +} + +enum image_format_class +{ + /** Not a valid image format. */ + IMAGE_FORMAT_CLASS_NONE = 0, + + /** Classes of image formats you can cast into each other. */ + /** \{ */ + IMAGE_FORMAT_CLASS_1X8, + IMAGE_FORMAT_CLASS_1X16, + IMAGE_FORMAT_CLASS_1X32, + IMAGE_FORMAT_CLASS_2X8, + IMAGE_FORMAT_CLASS_2X16, + IMAGE_FORMAT_CLASS_2X32, + IMAGE_FORMAT_CLASS_10_11_11, + IMAGE_FORMAT_CLASS_4X8, + IMAGE_FORMAT_CLASS_4X16, + IMAGE_FORMAT_CLASS_4X32, + IMAGE_FORMAT_CLASS_2_10_10_10 + /** \} */ +}; + +static enum image_format_class +get_image_format_class(gl_format format) +{ + switch (format) { + case MESA_FORMAT_RGBA_FLOAT32: + return IMAGE_FORMAT_CLASS_4X32; + + case MESA_FORMAT_RGBA_FLOAT16: + return IMAGE_FORMAT_CLASS_4X16; + + case MESA_FORMAT_RG_FLOAT32: + return IMAGE_FORMAT_CLASS_2X32; + + case MESA_FORMAT_RG_FLOAT16: + return IMAGE_FORMAT_CLASS_2X16; + + case MESA_FORMAT_R11_G11_B10_FLOAT: + return IMAGE_FORMAT_CLASS_10_11_11; + + case MESA_FORMAT_R_FLOAT32: + return IMAGE_FORMAT_CLASS_1X32; + + case MESA_FORMAT_R_FLOAT16: + return IMAGE_FORMAT_CLASS_1X16; + + case MESA_FORMAT_RGBA_UINT32: + return IMAGE_FORMAT_CLASS_4X32; + + case MESA_FORMAT_RGBA_UINT16: + return IMAGE_FORMAT_CLASS_4X16; + + case MESA_FORMAT_ABGR2101010_UINT: + return IMAGE_FORMAT_CLASS_2_10_10_10; + + case MESA_FORMAT_RGBA_UINT8: + return IMAGE_FORMAT_CLASS_4X8; + + case MESA_FORMAT_RG_UINT32: + return IMAGE_FORMAT_CLASS_2X32; + + case MESA_FORMAT_RG_UINT16: + return IMAGE_FORMAT_CLASS_2X16; + + case MESA_FORMAT_RG_UINT8: + return IMAGE_FORMAT_CLASS_2X8; + + case MESA_FORMAT_R_UINT32: + return IMAGE_FORMAT_CLASS_1X32; + + case MESA_FORMAT_R_UINT16: + return IMAGE_FORMAT_CLASS_1X16; + + case MESA_FORMAT_R_UINT8: + return IMAGE_FORMAT_CLASS_1X8; + + case MESA_FORMAT_RGBA_INT32: + return IMAGE_FORMAT_CLASS_4X32; + + case MESA_FORMAT_RGBA_INT16: + return IMAGE_FORMAT_CLASS_4X16; + + case MESA_FORMAT_RGBA_INT8: + return IMAGE_FORMAT_CLASS_4X8; + + case MESA_FORMAT_RG_INT32: + return IMAGE_FORMAT_CLASS_2X32; + + case MESA_FORMAT_RG_INT16: + return IMAGE_FORMAT_CLASS_2X16; + + case MESA_FORMAT_RG_INT8: + return IMAGE_FORMAT_CLASS_2X8; + + case MESA_FORMAT_R_INT32: + return IMAGE_FORMAT_CLASS_1X32; + + case MESA_FORMAT_R_INT16: + return IMAGE_FORMAT_CLASS_1X16; + + case MESA_FORMAT_R_INT8: + return IMAGE_FORMAT_CLASS_1X8; + + case MESA_FORMAT_RGBA_16: + return IMAGE_FORMAT_CLASS_4X16; + + case MESA_FORMAT_ABGR2101010: + return IMAGE_FORMAT_CLASS_2_10_10_10; + + case MESA_FORMAT_RGBA_8: + return IMAGE_FORMAT_CLASS_4X8; + + case MESA_FORMAT_RG_16: + return IMAGE_FORMAT_CLASS_2X16; + + case MESA_FORMAT_RG_8: + return IMAGE_FORMAT_CLASS_2X8; + + case MESA_FORMAT_R16: + return IMAGE_FORMAT_CLASS_1X16; + + case MESA_FORMAT_R8: + return IMAGE_FORMAT_CLASS_1X8; + + case MESA_FORMAT_SIGNED_RGBA_16: + return IMAGE_FORMAT_CLASS_4X16; + + case MESA_FORMAT_SIGNED_RGBA_8: + return IMAGE_FORMAT_CLASS_4X8; + + case MESA_FORMAT_SIGNED_RG_16: + return IMAGE_FORMAT_CLASS_2X16; + + case MESA_FORMAT_SIGNED_RG_8: + return IMAGE_FORMAT_CLASS_2X8; + + case MESA_FORMAT_SIGNED_R16: + return IMAGE_FORMAT_CLASS_1X16; + + case MESA_FORMAT_SIGNED_R8: + return IMAGE_FORMAT_CLASS_1X8; + + default: + return IMAGE_FORMAT_CLASS_NONE; + } +} + +static GLboolean +validate_image_unit(struct gl_context *ctx, struct gl_image_unit *u) +{ + struct gl_texture_object *t = u->TexObj; + struct gl_texture_image *img; + + if (!t || u->Level < t->BaseLevel || + u->Level > t->_MaxLevel) + return GL_FALSE; + + _mesa_test_texobj_completeness(ctx, t); + + if ((u->Level == t->BaseLevel && !t->_BaseComplete) || + (u->Level != t->BaseLevel && !t->_MipmapComplete)) + return GL_FALSE; + + if (_mesa_tex_target_is_layered(t->Target) && + u->Layer >= _mesa_get_texture_layers(t, u->Level)) + return GL_FALSE; + + if (t->Target == GL_TEXTURE_CUBE_MAP) + img = t->Image[u->Layer][u->Level]; + else + img = t->Image[0][u->Level]; + + if (!img || img->Border || + get_image_format_class(img->TexFormat) == IMAGE_FORMAT_CLASS_NONE || + img->NumSamples > ctx->Const.MaxImageSamples) + return GL_FALSE; + + switch (t->ImageFormatCompatibilityType) { + case GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE: + if (_mesa_get_format_bytes(img->TexFormat) != + _mesa_get_format_bytes(u->_ActualFormat)) + return GL_FALSE; + break; + + case GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS: + if (get_image_format_class(img->TexFormat) != + get_image_format_class(u->_ActualFormat)) + return GL_FALSE; + break; + + default: + assert(!"Unexpected image format compatibility type"); + } + + return GL_TRUE; +} + +void +_mesa_validate_image_units(struct gl_context *ctx) +{ + int i; + + for (i = 0; i < ctx->Const.MaxImageUnits; ++i) { + struct gl_image_unit *u = &ctx->ImageUnits[i]; + u->_Valid = validate_image_unit(ctx, u); + } +} + +static GLboolean +validate_bind_image_texture(struct gl_context *ctx, GLuint unit, + GLuint texture, GLint level, GLboolean layered, + GLint layer, GLenum access, GLenum format) +{ + assert(ctx->Const.MaxImageUnits <= MAX_IMAGE_UNITS); + + if (unit >= ctx->Const.MaxImageUnits) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindImageTexture(unit)"); + return GL_FALSE; + } + + if (level < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindImageTexture(level)"); + return GL_FALSE; + } + + if (layer < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindImageTexture(layer)"); + return GL_FALSE; + } + + if (access != GL_READ_ONLY && + access != GL_WRITE_ONLY && + access != GL_READ_WRITE) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindImageTexture(access)"); + return GL_FALSE; + } + + if (!get_image_format(format)) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindImageTexture(format)"); + return GL_FALSE; + } + + return GL_TRUE; +} + +void GLAPIENTRY +_mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level, + GLboolean layered, GLint layer, GLenum access, + GLenum format) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_object *t = NULL; + struct gl_image_unit *u; + + if (!validate_bind_image_texture(ctx, unit, texture, level, + layered, layer, access, format)) + return; + + u = &ctx->ImageUnits[unit]; + + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewImageUnits; + + if (texture) { + t = _mesa_lookup_texture(ctx, texture); + if (!t) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindImageTexture(texture)"); + return; + } + + _mesa_reference_texobj(&u->TexObj, t); + u->Level = level; + u->Access = access; + u->Format = format; + u->_ActualFormat = get_image_format(format); + + if (_mesa_tex_target_is_layered(t->Target)) { + u->Layered = layered; + u->Layer = (layered ? 0 : layer); + } else { + u->Layered = GL_FALSE; + u->Layer = 0; + } + + } else { + _mesa_reference_texobj(&u->TexObj, NULL); + } + + u->_Valid = validate_image_unit(ctx, u); + + if (ctx->Driver.BindImageTexture) + ctx->Driver.BindImageTexture(ctx, u, t, level, layered, + layer, access, format); +} + +void GLAPIENTRY +_mesa_MemoryBarrier(GLbitfield barriers) +{ + GET_CURRENT_CONTEXT(ctx); + + if (ctx->Driver.MemoryBarrier) + ctx->Driver.MemoryBarrier(ctx, barriers); +} diff --git a/mesalib/src/mesa/main/shaderimage.h b/mesalib/src/mesa/main/shaderimage.h new file mode 100644 index 000000000..aaecc5d29 --- /dev/null +++ b/mesalib/src/mesa/main/shaderimage.h @@ -0,0 +1,51 @@ +/* + * Copyright 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: + * Francisco Jerez <currojerez@riseup.net> + */ + +#ifndef SHADERIMAGE_H +#define SHADERIMAGE_H + +#include "glheader.h" + +struct gl_context; + +/** + * Recalculate the \c _Valid flag of a context's shader image units. + * + * To be called when the state of any texture bound to an image unit + * changes. + */ +void +_mesa_validate_image_units(struct gl_context *ctx); + +void GLAPIENTRY +_mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level, + GLboolean layered, GLint layer, GLenum access, + GLenum format); + +void GLAPIENTRY +_mesa_MemoryBarrier(GLbitfield barriers); + +#endif diff --git a/mesalib/src/mesa/main/shaderobj.c b/mesalib/src/mesa/main/shaderobj.c index 0d794ad96..dc81bbc77 100644 --- a/mesalib/src/mesa/main/shaderobj.c +++ b/mesalib/src/mesa/main/shaderobj.c @@ -110,6 +110,7 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type) shader = rzalloc(NULL, struct gl_shader); if (shader) { shader->Type = type; + shader->Stage = _mesa_shader_enum_to_shader_stage(type); shader->Name = name; _mesa_init_shader(ctx, shader); } @@ -307,7 +308,7 @@ _mesa_free_shader_program_data(struct gl_context *ctx, struct gl_shader_program *shProg) { GLuint i; - gl_shader_type sh; + gl_shader_stage sh; assert(shProg->Type == GL_SHADER_PROGRAM_MESA); @@ -346,7 +347,7 @@ _mesa_free_shader_program_data(struct gl_context *ctx, shProg->TransformFeedback.NumVarying = 0; - for (sh = 0; sh < MESA_SHADER_TYPES; sh++) { + for (sh = 0; sh < MESA_SHADER_STAGES; sh++) { if (shProg->_LinkedShaders[sh] != NULL) { ctx->Driver.DeleteShader(ctx, shProg->_LinkedShaders[sh]); shProg->_LinkedShaders[sh] = NULL; diff --git a/mesalib/src/mesa/main/shaderobj.h b/mesalib/src/mesa/main/shaderobj.h index 155058d71..517557088 100644 --- a/mesalib/src/mesa/main/shaderobj.h +++ b/mesalib/src/mesa/main/shaderobj.h @@ -101,8 +101,8 @@ extern void _mesa_free_shader_state(struct gl_context *ctx); -static inline gl_shader_type -_mesa_shader_type_to_index(GLenum v) +static inline gl_shader_stage +_mesa_shader_enum_to_shader_stage(GLenum v) { switch (v) { case GL_VERTEX_SHADER: @@ -112,7 +112,7 @@ _mesa_shader_type_to_index(GLenum v) case GL_GEOMETRY_SHADER: return MESA_SHADER_GEOMETRY; default: - ASSERT(0 && "bad value in _mesa_shader_type_to_index()"); + ASSERT(0 && "bad value in _mesa_shader_enum_to_shader_stage()"); return MESA_SHADER_VERTEX; } } diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c index e71d0c411..47ad30605 100644 --- a/mesalib/src/mesa/main/texcompress.c +++ b/mesalib/src/mesa/main/texcompress.c @@ -263,6 +263,43 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats) else { n += 3; } + + /* The ES and desktop GL specs diverge here. + * + * In desktop OpenGL, the driver can perform online compression of + * uncompressed texture data. GL_NUM_COMPRESSED_TEXTURE_FORMATS and + * GL_COMPRESSED_TEXTURE_FORMATS give the application a list of + * formats that it could ask the driver to compress with some + * expectation of quality. The GL_ARB_texture_compression spec + * calls this "suitable for general-purpose usage." As noted + * above, this means GL_COMPRESSED_RGBA_S3TC_DXT1_EXT is not + * included in the list. + * + * In OpenGL ES, the driver never performs compression. + * GL_NUM_COMPRESSED_TEXTURE_FORMATS and + * GL_COMPRESSED_TEXTURE_FORMATS give the application a list of + * formats that the driver can receive from the application. It + * is the *complete* list of formats. The + * GL_EXT_texture_compression_s3tc spec says: + * + * "New State for OpenGL ES 2.0.25 and 3.0.2 Specifications + * + * The queries for NUM_COMPRESSED_TEXTURE_FORMATS and + * COMPRESSED_TEXTURE_FORMATS include + * COMPRESSED_RGB_S3TC_DXT1_EXT, + * COMPRESSED_RGBA_S3TC_DXT1_EXT, + * COMPRESSED_RGBA_S3TC_DXT3_EXT, and + * COMPRESSED_RGBA_S3TC_DXT5_EXT." + * + * Note that the addition is only to the OpenGL ES specification! + */ + if (_mesa_is_gles(ctx)) { + if (formats) { + formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + } else { + n += 1; + } + } } /* The GL_OES_compressed_ETC1_RGB8_texture spec says: diff --git a/mesalib/src/mesa/main/texenv.c b/mesalib/src/mesa/main/texenv.c index 1aadd7fde..4848208f5 100644 --- a/mesalib/src/mesa/main/texenv.c +++ b/mesalib/src/mesa/main/texenv.c @@ -879,7 +879,7 @@ _mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param ) } else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) { GLint count = 0; - for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) { if (ctx->Const.SupportedBumpUnits & (1 << i)) { count++; } @@ -887,7 +887,7 @@ _mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param ) *param = count; } else if (pname == GL_BUMP_TEX_UNITS_ATI) { - for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) { if (ctx->Const.SupportedBumpUnits & (1 << i)) { *param++ = i + GL_TEXTURE0; } @@ -928,7 +928,7 @@ _mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param ) } else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) { GLint count = 0; - for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) { if (ctx->Const.SupportedBumpUnits & (1 << i)) { count++; } @@ -936,7 +936,7 @@ _mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param ) *param = (GLfloat) count; } else if (pname == GL_BUMP_TEX_UNITS_ATI) { - for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) { if (ctx->Const.SupportedBumpUnits & (1 << i)) { *param++ = (GLfloat) (i + GL_TEXTURE0); } diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 9c3f1e86e..8aac54e9d 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -1088,6 +1088,93 @@ _mesa_get_texture_dimensions(GLenum target) /** + * Check if a texture target can have more than one layer. + */ +GLboolean +_mesa_tex_target_is_layered(GLenum target) +{ + switch (target) { + case GL_TEXTURE_1D: + case GL_PROXY_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_PROXY_TEXTURE_2D: + case GL_TEXTURE_RECTANGLE: + case GL_PROXY_TEXTURE_RECTANGLE: + case GL_TEXTURE_2D_MULTISAMPLE: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE: + case GL_TEXTURE_BUFFER: + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + case GL_TEXTURE_EXTERNAL_OES: + return GL_FALSE; + + case GL_TEXTURE_3D: + case GL_PROXY_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + case GL_PROXY_TEXTURE_CUBE_MAP: + case GL_TEXTURE_1D_ARRAY: + case GL_PROXY_TEXTURE_1D_ARRAY: + case GL_TEXTURE_2D_ARRAY: + case GL_PROXY_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: + return GL_TRUE; + + default: + assert(!"Invalid texture target."); + return GL_FALSE; + } +} + + +/** + * Return the number of layers present in the given level of an array, + * cubemap or 3D texture. If the texture is not layered return zero. + */ +GLuint +_mesa_get_texture_layers(const struct gl_texture_object *texObj, GLint level) +{ + assert(level >= 0 && level < MAX_TEXTURE_LEVELS); + + switch (texObj->Target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_RECTANGLE: + case GL_TEXTURE_2D_MULTISAMPLE: + case GL_TEXTURE_BUFFER: + case GL_TEXTURE_EXTERNAL_OES: + return 0; + + case GL_TEXTURE_CUBE_MAP: + return 6; + + case GL_TEXTURE_1D_ARRAY: { + struct gl_texture_image *img = texObj->Image[0][level]; + return img ? img->Height : 0; + } + + case GL_TEXTURE_3D: + case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: { + struct gl_texture_image *img = texObj->Image[0][level]; + return img ? img->Depth : 0; + } + + default: + assert(!"Invalid texture target."); + return 0; + } +} + + +/** * Return the maximum number of mipmap levels for the given target * and the dimensions. * The dimensions are expected not to include the border. diff --git a/mesalib/src/mesa/main/teximage.h b/mesalib/src/mesa/main/teximage.h index 0b5786340..80a0a57b5 100644 --- a/mesalib/src/mesa/main/teximage.h +++ b/mesalib/src/mesa/main/teximage.h @@ -138,6 +138,12 @@ _mesa_tex_target_to_face(GLenum target); extern GLint _mesa_get_texture_dimensions(GLenum target); +extern GLboolean +_mesa_tex_target_is_layered(GLenum target); + +extern GLuint +_mesa_get_texture_layers(const struct gl_texture_object *texObj, GLint level); + extern GLsizei _mesa_get_tex_max_num_levels(GLenum target, GLsizei width, GLsizei height, GLsizei depth); diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c index d6510fefd..3c64c4376 100644 --- a/mesalib/src/mesa/main/texobj.c +++ b/mesalib/src/mesa/main/texobj.c @@ -157,6 +157,7 @@ _mesa_initialize_texture_object( struct gl_context *ctx, obj->Sampler.sRGBDecode = GL_DECODE_EXT; obj->BufferObjectFormat = GL_R8; obj->_BufferObjectFormat = MESA_FORMAT_R8; + obj->ImageFormatCompatibilityType = GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE; } @@ -1099,6 +1100,25 @@ unbind_texobj_from_texunits(struct gl_context *ctx, /** + * Check if the given texture object is bound to any shader image unit + * and unbind it if that's the case. + */ +static void +unbind_texobj_from_imgunits(struct gl_context *ctx, + struct gl_texture_object *texObj) +{ + int i; + + for (i = 0; i < ctx->Const.MaxImageUnits; i++) { + struct gl_image_unit *unit = &ctx->ImageUnits[i]; + + if (texObj == unit->TexObj) + _mesa_reference_texobj(&unit->TexObj, NULL); + } +} + + +/** * Delete named textures. * * \param n number of textures to be deleted. @@ -1145,6 +1165,12 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) */ unbind_texobj_from_texunits(ctx, delObj); + /* Check if this texture is currently bound to any shader + * image unit. If so, unbind it. + * See section 3.9.X of GL_ARB_shader_image_load_store. + */ + unbind_texobj_from_imgunits(ctx, delObj); + _mesa_unlock_texture(ctx, delObj); ctx->NewState |= _NEW_TEXTURE; diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index 94e498d20..7c59d119f 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -1808,6 +1808,12 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) *params = obj->Sampler.sRGBDecode; break; + case GL_IMAGE_FORMAT_COMPATIBILITY_TYPE: + if (!ctx->Extensions.ARB_shader_image_load_store) + goto invalid_pname; + *params = obj->ImageFormatCompatibilityType; + break; + default: goto invalid_pname; } diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c index ad80dcfaa..7720965a8 100644 --- a/mesalib/src/mesa/main/texstate.c +++ b/mesalib/src/mesa/main/texstate.c @@ -35,6 +35,7 @@ #include "context.h" #include "enums.h" #include "macros.h" +#include "shaderimage.h" #include "texobj.h" #include "teximage.h" #include "texstate.h" @@ -674,6 +675,8 @@ update_texture_state( struct gl_context *ctx ) if (!fprog || !vprog) update_texgen(ctx); + + _mesa_validate_image_units(ctx); } diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index 5adbd5dc9..8eaf43a6a 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -2191,6 +2191,7 @@ _mesa_texstore_snorm88(TEXSTORE_PARAMS) const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_AL88 || + dstFormat == MESA_FORMAT_SIGNED_RG88 || dstFormat == MESA_FORMAT_SIGNED_RG88_REV); ASSERT(_mesa_get_format_bytes(dstFormat) == 2); @@ -2210,13 +2211,27 @@ _mesa_texstore_snorm88(TEXSTORE_PARAMS) for (img = 0; img < srcDepth; img++) { GLbyte *dstRow = (GLbyte *) dstSlices[img]; for (row = 0; row < srcHeight; row++) { - GLbyte *dst = dstRow; - for (col = 0; col < srcWidth; col++) { - dst[0] = FLOAT_TO_BYTE_TEX(src[0]); - dst[1] = FLOAT_TO_BYTE_TEX(src[1]); - src += 2; - dst += 2; + GLushort *dst = (GLushort *) dstRow; + + if (dstFormat == MESA_FORMAT_SIGNED_AL88 || + dstFormat == MESA_FORMAT_SIGNED_RG88_REV) { + for (col = 0; col < srcWidth; col++) { + GLubyte l = FLOAT_TO_BYTE_TEX(src[0]); + GLubyte a = FLOAT_TO_BYTE_TEX(src[1]); + + dst[col] = PACK_COLOR_88_REV(l, a); + src += 2; + } + } else { + for (col = 0; col < srcWidth; col++) { + GLubyte l = FLOAT_TO_BYTE_TEX(src[0]); + GLubyte a = FLOAT_TO_BYTE_TEX(src[1]); + + dst[col] = PACK_COLOR_88(l, a); + src += 2; + } } + dstRow += dstRowStride; } } @@ -2278,6 +2293,7 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS) const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_AL1616 || + dstFormat == MESA_FORMAT_SIGNED_RG1616 || dstFormat == MESA_FORMAT_SIGNED_GR1616); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); @@ -2297,17 +2313,29 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS) for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = dstSlices[img]; for (row = 0; row < srcHeight; row++) { - GLshort *dst = (GLshort *) dstRow; - for (col = 0; col < srcWidth; col++) { - GLushort l, a; + GLuint *dst = (GLuint *) dstRow; - UNCLAMPED_FLOAT_TO_SHORT(l, src[0]); - UNCLAMPED_FLOAT_TO_SHORT(a, src[1]); - dst[0] = l; - dst[1] = a; - src += 2; - dst += 2; + if (dstFormat == MESA_FORMAT_SIGNED_AL1616 || + dstFormat == MESA_FORMAT_SIGNED_GR1616) { + for (col = 0; col < srcWidth; col++) { + GLushort l, a; + + UNCLAMPED_FLOAT_TO_SHORT(l, src[0]); + UNCLAMPED_FLOAT_TO_SHORT(a, src[1]); + dst[col] = PACK_COLOR_1616_REV(l, a); + src += 2; + } + } else { + for (col = 0; col < srcWidth; col++) { + GLushort l, a; + + UNCLAMPED_FLOAT_TO_SHORT(l, src[0]); + UNCLAMPED_FLOAT_TO_SHORT(a, src[1]); + dst[col] = PACK_COLOR_1616_REV(l, a); + src += 2; + } } + dstRow += dstRowStride; } } @@ -3559,6 +3587,50 @@ _mesa_texstore_abgr2101010_uint(TEXSTORE_PARAMS) } static GLboolean +_mesa_texstore_abgr2101010(TEXSTORE_PARAMS) +{ + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_ABGR2101010); + ASSERT(_mesa_get_format_bytes(dstFormat) == 4); + + { + /* general path */ + const GLfloat *tempImage = _mesa_make_temp_float_image(ctx, dims, + baseInternalFormat, + baseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking, + ctx->_ImageTransferState); + const GLfloat *src = tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = dstSlices[img]; + + for (row = 0; row < srcHeight; row++) { + GLuint *dstUI = (GLuint *) dstRow; + for (col = 0; col < srcWidth; col++) { + GLushort a,r,g,b; + + UNCLAMPED_FLOAT_TO_USHORT(a, src[ACOMP]); + UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]); + UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]); + dstUI[col] = PACK_COLOR_2101010_US(a, b, g, r); + src += 4; + } + dstRow += dstRowStride; + } + } + free((void *) tempImage); + } + return GL_TRUE; +} + +static GLboolean _mesa_texstore_null(TEXSTORE_PARAMS) { (void) ctx; (void) dims; @@ -3782,6 +3854,11 @@ _mesa_get_texstore_func(gl_format format) table[MESA_FORMAT_XBGR32323232_UINT] = _mesa_texstore_rgba_uint32; table[MESA_FORMAT_XBGR32323232_SINT] = _mesa_texstore_rgba_int32; + table[MESA_FORMAT_ABGR2101010] = _mesa_texstore_abgr2101010; + + table[MESA_FORMAT_SIGNED_RG88] = _mesa_texstore_snorm88; + table[MESA_FORMAT_SIGNED_RG1616] = _mesa_texstore_snorm1616; + initialized = GL_TRUE; } diff --git a/mesalib/src/mesa/main/uniform_query.cpp b/mesalib/src/mesa/main/uniform_query.cpp index 61bcbcb8a..82d7628e8 100644 --- a/mesalib/src/mesa/main/uniform_query.cpp +++ b/mesalib/src/mesa/main/uniform_query.cpp @@ -445,14 +445,14 @@ log_uniform(const void *values, enum glsl_base_type basicType, static void log_program_parameters(const struct gl_shader_program *shProg) { - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (shProg->_LinkedShaders[i] == NULL) continue; const struct gl_program *const prog = shProg->_LinkedShaders[i]->Program; printf("Program %d %s shader parameters:\n", - shProg->Name, _mesa_shader_enum_to_string(prog->Target)); + shProg->Name, _mesa_shader_stage_to_string(i)); for (unsigned j = 0; j < prog->Parameters->NumParameters; j++) { printf("%s: %p %f %f %f %f\n", prog->Parameters->Parameters[j].Name, @@ -784,7 +784,7 @@ _mesa_uniform(struct gl_context *ctx, struct gl_shader_program *shProg, int i; bool flushed = false; - for (i = 0; i < MESA_SHADER_TYPES; i++) { + for (i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_shader *const sh = shProg->_LinkedShaders[i]; int j; diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c index 17e24f678..071d668f3 100644 --- a/mesalib/src/mesa/main/uniforms.c +++ b/mesalib/src/mesa/main/uniforms.c @@ -68,7 +68,7 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg, { GLuint s; struct gl_shader *shader = - shProg->_LinkedShaders[_mesa_program_target_to_index(prog->Target)]; + shProg->_LinkedShaders[_mesa_program_enum_to_shader_stage(prog->Target)]; assert(shader); @@ -642,7 +642,7 @@ _mesa_UniformBlockBinding(GLuint program, shProg->UniformBlocks[uniformBlockIndex].Binding = uniformBlockBinding; - for (i = 0; i < MESA_SHADER_TYPES; i++) { + for (i = 0; i < MESA_SHADER_STAGES; i++) { int stage_index = shProg->UniformBlockStageIndex[i][uniformBlockIndex]; if (stage_index != -1) { diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index 0f38270d5..b73a396e2 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -621,7 +621,7 @@ _mesa_VertexAttribPointer(GLuint index, GLint size, GLenum type, UNSIGNED_INT_10F_11F_11F_REV_BIT); GET_CURRENT_CONTEXT(ctx); - if (index >= ctx->Const.VertexProgram.MaxAttribs) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(index)"); return; } @@ -649,7 +649,7 @@ _mesa_VertexAttribIPointer(GLuint index, GLint size, GLenum type, const GLboolean integer = GL_TRUE; GET_CURRENT_CONTEXT(ctx); - if (index >= ctx->Const.VertexProgram.MaxAttribs) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribIPointer(index)"); return; } @@ -667,7 +667,7 @@ _mesa_EnableVertexAttribArray(GLuint index) struct gl_array_object *arrayObj; GET_CURRENT_CONTEXT(ctx); - if (index >= ctx->Const.VertexProgram.MaxAttribs) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glEnableVertexAttribArrayARB(index)"); return; @@ -693,7 +693,7 @@ _mesa_DisableVertexAttribArray(GLuint index) struct gl_array_object *arrayObj; GET_CURRENT_CONTEXT(ctx); - if (index >= ctx->Const.VertexProgram.MaxAttribs) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glDisableVertexAttribArrayARB(index)"); return; @@ -725,7 +725,7 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname, const struct gl_array_object *arrayObj = ctx->Array.ArrayObj; const struct gl_vertex_attrib_array *array; - if (index >= ctx->Const.VertexProgram.MaxAttribs) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", caller, index); return 0; } @@ -795,7 +795,7 @@ get_current_attrib(struct gl_context *ctx, GLuint index, const char *function) return NULL; } } - else if (index >= ctx->Const.VertexProgram.MaxAttribs) { + else if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(index>=GL_MAX_VERTEX_ATTRIBS)", function); return NULL; @@ -913,7 +913,7 @@ _mesa_GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid **pointer) { GET_CURRENT_CONTEXT(ctx); - if (index >= ctx->Const.VertexProgram.MaxAttribs) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribPointerARB(index)"); return; } @@ -1308,7 +1308,7 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor) return; } - if (index >= ctx->Const.VertexProgram.MaxAttribs) { + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribDivisor(index = %u)", index); return; @@ -1479,7 +1479,7 @@ _mesa_VertexAttribFormat(GLuint attribIndex, GLint size, GLenum type, * "The error INVALID_VALUE is generated if index is greater than or equal * to the value of MAX_VERTEX_ATTRIBS." */ - if (attribIndex >= ctx->Const.VertexProgram.MaxAttribs) { + if (attribIndex >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribFormat(attribindex=%u > " "GL_MAX_VERTEX_ATTRIBS)", @@ -1526,7 +1526,7 @@ _mesa_VertexAttribIFormat(GLuint attribIndex, GLint size, GLenum type, * "The error INVALID_VALUE is generated if index is greater than * or equal to the value of MAX_VERTEX_ATTRIBS." */ - if (attribIndex >= ctx->Const.VertexProgram.MaxAttribs) { + if (attribIndex >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribIFormat(attribindex=%u > " "GL_MAX_VERTEX_ATTRIBS)", @@ -1574,7 +1574,7 @@ _mesa_VertexAttribLFormat(GLuint attribIndex, GLint size, GLenum type, * "The error INVALID_VALUE is generated if <attribindex> is greater than * or equal to the value of MAX_VERTEX_ATTRIBS." */ - if (attribIndex >= ctx->Const.VertexProgram.MaxAttribs) { + if (attribIndex >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribLFormat(attribindex=%u > " "GL_MAX_VERTEX_ATTRIBS)", @@ -1616,7 +1616,7 @@ _mesa_VertexAttribBinding(GLuint attribIndex, GLuint bindingIndex) * MAX_VERTEX_ATTRIB_BINDINGS, otherwise the error INVALID_VALUE * is generated." */ - if (attribIndex >= ctx->Const.VertexProgram.MaxAttribs) { + if (attribIndex >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribBinding(attribindex=%u >= " "GL_MAX_VERTEX_ATTRIBS)", diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c index 119c7dae3..587cb9ad5 100644 --- a/mesalib/src/mesa/main/version.c +++ b/mesalib/src/mesa/main/version.c @@ -255,7 +255,7 @@ compute_version(struct gl_context *ctx) ctx->Extensions.EXT_texture_snorm && ctx->Extensions.NV_primitive_restart && ctx->Extensions.NV_texture_rectangle && - ctx->Const.VertexProgram.MaxTextureImageUnits >= 16); + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits >= 16); const GLboolean ver_3_2 = (ver_3_1 && ctx->Const.GLSLVersion >= 150 && ctx->Extensions.ARB_depth_clamp && diff --git a/mesalib/src/mesa/main/viewport.c b/mesalib/src/mesa/main/viewport.c index 91578ba9d..3aaab2d46 100644 --- a/mesalib/src/mesa/main/viewport.c +++ b/mesalib/src/mesa/main/viewport.c @@ -99,7 +99,7 @@ _mesa_set_viewport(struct gl_context *ctx, GLint x, GLint y, /* Many drivers will use this call to check for window size changes * and reallocate the z/stencil/accum/etc buffers if needed. */ - ctx->Driver.Viewport(ctx, x, y, width, height); + ctx->Driver.Viewport(ctx); } } @@ -143,7 +143,7 @@ _mesa_DepthRange(GLclampd nearval, GLclampd farval) #endif if (ctx->Driver.DepthRange) { - ctx->Driver.DepthRange(ctx, nearval, farval); + ctx->Driver.DepthRange(ctx); } } diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index beb0c093b..85d414259 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/src/mesa/program/ir_to_mesa.cpp @@ -665,8 +665,8 @@ ir_to_mesa_visitor::find_variable_storage(ir_variable *var) variable_storage *entry; - foreach_iter(exec_list_iterator, iter, this->variables) { - entry = (variable_storage *)iter.get(); + foreach_list(node, &this->variables) { + entry = (variable_storage *) node; if (entry->var == var) return entry; @@ -801,8 +801,8 @@ ir_to_mesa_visitor::visit(ir_function *ir) assert(sig); - foreach_iter(exec_list_iterator, iter, sig->body) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(node, &sig->body) { + ir_instruction *ir = (ir_instruction *) node; ir->accept(this); } @@ -1868,8 +1868,8 @@ ir_to_mesa_visitor::visit(ir_constant *ir) src_reg temp_base = get_temp(ir->type); dst_reg temp = dst_reg(temp_base); - foreach_iter(exec_list_iterator, iter, ir->components) { - ir_constant *field_value = (ir_constant *)iter.get(); + foreach_list(node, &ir->components) { + ir_constant *field_value = (ir_constant *) node; int size = type_size(field_value->type); assert(size > 0); @@ -2338,8 +2338,8 @@ set_branchtargets(ir_to_mesa_visitor *v, mesa_instructions[loop_stack[loop_stack_pos]].BranchTarget = i; break; case OPCODE_CAL: - foreach_iter(exec_list_iterator, iter, v->function_signatures) { - function_entry *entry = (function_entry *)iter.get(); + foreach_list(n, &v->function_signatures) { + function_entry *entry = (function_entry *) n; if (entry->sig_id == mesa_instructions[i].BranchTarget) { mesa_instructions[i].BranchTarget = entry->inst; @@ -2392,7 +2392,7 @@ class add_uniform_to_shader : public program_resource_visitor { public: add_uniform_to_shader(struct gl_shader_program *shader_program, struct gl_program_parameter_list *params, - gl_shader_type shader_type) + gl_shader_stage shader_type) : shader_program(shader_program), params(params), idx(-1), shader_type(shader_type) { @@ -2414,7 +2414,7 @@ private: struct gl_shader_program *shader_program; struct gl_program_parameter_list *params; int idx; - gl_shader_type shader_type; + gl_shader_stage shader_type; }; } /* anonymous namespace */ @@ -2493,8 +2493,7 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program struct gl_program_parameter_list *params) { - add_uniform_to_shader add(shader_program, params, - _mesa_shader_type_to_index(sh->Type)); + add_uniform_to_shader add(shader_program, params, sh->Stage); foreach_list(node, sh->ir) { ir_variable *var = ((ir_instruction *) node)->as_variable(); @@ -2621,8 +2620,8 @@ ir_to_mesa_visitor::copy_propagate(void) int *acp_level = rzalloc_array(mem_ctx, int, this->next_temp * 4); int level = 0; - foreach_iter(exec_list_iterator, iter, this->instructions) { - ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *) node; assert(inst->dst.file != PROGRAM_TEMPORARY || inst->dst.index < this->next_temp); @@ -2800,25 +2799,10 @@ get_mesa_program(struct gl_context *ctx, ir_instruction **mesa_instruction_annotation; int i; struct gl_program *prog; - GLenum target; - const char *target_string = _mesa_shader_enum_to_string(shader->Type); + GLenum target = _mesa_shader_stage_to_program(shader->Stage); + const char *target_string = _mesa_shader_stage_to_string(shader->Stage); struct gl_shader_compiler_options *options = - &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)]; - - switch (shader->Type) { - case GL_VERTEX_SHADER: - target = GL_VERTEX_PROGRAM_ARB; - break; - case GL_FRAGMENT_SHADER: - target = GL_FRAGMENT_PROGRAM_ARB; - break; - case GL_GEOMETRY_SHADER: - target = GL_GEOMETRY_PROGRAM_NV; - break; - default: - assert(!"should not be reached"); - return NULL; - } + &ctx->ShaderCompilerOptions[shader->Stage]; validate_ir_tree(shader->ir); @@ -2841,7 +2825,7 @@ get_mesa_program(struct gl_context *ctx, prog->NumTemporaries = v.next_temp; int num_instructions = 0; - foreach_iter(exec_list_iterator, iter, v.instructions) { + foreach_list(node, &v.instructions) { num_instructions++; } @@ -2857,8 +2841,8 @@ get_mesa_program(struct gl_context *ctx, */ mesa_inst = mesa_instructions; i = 0; - foreach_iter(exec_list_iterator, iter, v.instructions) { - const ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get(); + foreach_list(node, &v.instructions) { + const ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *) node; mesa_inst->Opcode = inst->op; mesa_inst->CondUpdate = inst->cond_update; @@ -2952,7 +2936,7 @@ get_mesa_program(struct gl_context *ctx, */ mesa_instructions = NULL; - do_set_program_inouts(shader->ir, prog, shader->Type); + do_set_program_inouts(shader->ir, prog, shader->Stage); prog->SamplersUsed = shader->active_samplers; prog->ShadowSamplers = shader->shadow_samplers; @@ -3000,14 +2984,14 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) { assert(prog->LinkStatus); - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; bool progress; exec_list *ir = prog->_LinkedShaders[i]->ir; const struct gl_shader_compiler_options *options = - &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(prog->_LinkedShaders[i]->Type)]; + &ctx->ShaderCompilerOptions[prog->_LinkedShaders[i]->Stage]; do { progress = false; @@ -3055,7 +3039,7 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) validate_ir_tree(ir); } - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_program *linked_prog; if (prog->_LinkedShaders[i] == NULL) @@ -3064,7 +3048,7 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) linked_prog = get_mesa_program(ctx, prog, prog->_LinkedShaders[i]); if (linked_prog) { - _mesa_copy_linked_program_data((gl_shader_type) i, prog, linked_prog); + _mesa_copy_linked_program_data((gl_shader_stage) i, prog, linked_prog); _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program, linked_prog); diff --git a/mesalib/src/mesa/program/prog_print.c b/mesalib/src/mesa/program/prog_print.c index fa120cc5e..9391e99ff 100644 --- a/mesalib/src/mesa/program/prog_print.c +++ b/mesalib/src/mesa/program/prog_print.c @@ -1005,16 +1005,21 @@ _mesa_print_parameter_list(const struct gl_program_parameter_list *list) void _mesa_write_shader_to_file(const struct gl_shader *shader) { - const char *type; + const char *type = "????"; char filename[100]; FILE *f; - if (shader->Type == GL_FRAGMENT_SHADER) + switch (shader->Stage) { + case MESA_SHADER_FRAGMENT: type = "frag"; - else if (shader->Type == GL_VERTEX_SHADER) + break; + case MESA_SHADER_VERTEX: type = "vert"; - else + break; + case MESA_SHADER_GEOMETRY: type = "geom"; + break; + } _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "w"); @@ -1061,7 +1066,7 @@ _mesa_append_uniforms_to_file(const struct gl_shader *shader) char filename[100]; FILE *f; - if (shader->Type == GL_FRAGMENT_SHADER) + if (shader->Stage == MESA_SHADER_FRAGMENT) type = "frag"; else type = "vert"; diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c index cdf1c03fa..3c19e8c60 100644 --- a/mesalib/src/mesa/program/program.c +++ b/mesalib/src/mesa/program/program.c @@ -56,21 +56,21 @@ _mesa_init_program(struct gl_context *ctx) * If this assertion fails, we need to increase the field * size for register indexes (see INST_INDEX_BITS). */ - ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4 + ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4 <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4 + ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4 <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.VertexProgram.MaxTemps <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.VertexProgram.MaxLocalParams <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.FragmentProgram.MaxTemps <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.FragmentProgram.MaxLocalParams <= (1 << INST_INDEX_BITS)); + ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxTemps <= (1 << INST_INDEX_BITS)); + ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxLocalParams <= (1 << INST_INDEX_BITS)); + ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTemps <= (1 << INST_INDEX_BITS)); + ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS); - ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS); + ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents <= 4 * MAX_UNIFORMS); + ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents <= 4 * MAX_UNIFORMS); - ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS)); - ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS)); + ASSERT(ctx->Const.Program[MESA_SHADER_VERTEX].MaxAddressOffset <= (1 << INST_INDEX_BITS)); + ASSERT(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAddressOffset <= (1 << INST_INDEX_BITS)); /* If this fails, increase prog_instruction::TexSrcUnit size */ STATIC_ASSERT(MAX_TEXTURE_UNITS <= (1 << 5)); @@ -891,26 +891,13 @@ _mesa_find_free_register(const GLboolean used[], */ GLboolean _mesa_valid_register_index(const struct gl_context *ctx, - gl_shader_type shaderType, + gl_shader_stage shaderType, gl_register_file file, GLint index) { const struct gl_program_constants *c; - switch (shaderType) { - case MESA_SHADER_VERTEX: - c = &ctx->Const.VertexProgram; - break; - case MESA_SHADER_FRAGMENT: - c = &ctx->Const.FragmentProgram; - break; - case MESA_SHADER_GEOMETRY: - c = &ctx->Const.GeometryProgram; - break; - default: - _mesa_problem(ctx, - "unexpected shader type in _mesa_valid_register_index()"); - return GL_FALSE; - } + assert(0 <= shaderType && shaderType < MESA_SHADER_STAGES); + c = &ctx->Const.Program[shaderType]; switch (file) { case PROGRAM_UNDEFINED: diff --git a/mesalib/src/mesa/program/program.h b/mesalib/src/mesa/program/program.h index baff47376..0e350cd6f 100644 --- a/mesalib/src/mesa/program/program.h +++ b/mesalib/src/mesa/program/program.h @@ -181,7 +181,7 @@ _mesa_find_free_register(const GLboolean used[], extern GLboolean _mesa_valid_register_index(const struct gl_context *ctx, - gl_shader_type shaderType, + gl_shader_stage shaderType, gl_register_file file, GLint index); extern void @@ -192,7 +192,7 @@ _mesa_get_min_invocations_per_fragment(struct gl_context *ctx, const struct gl_fragment_program *prog); static inline GLuint -_mesa_program_target_to_index(GLenum v) +_mesa_program_enum_to_shader_stage(GLenum v) { switch (v) { case GL_VERTEX_PROGRAM_ARB: @@ -207,6 +207,24 @@ _mesa_program_target_to_index(GLenum v) } } + +static inline GLenum +_mesa_shader_stage_to_program(gl_shader_stage stage) +{ + switch (stage) { + case MESA_SHADER_VERTEX: + return GL_VERTEX_PROGRAM_ARB; + case MESA_SHADER_FRAGMENT: + return GL_FRAGMENT_PROGRAM_ARB; + case MESA_SHADER_GEOMETRY: + return GL_GEOMETRY_PROGRAM_NV; + } + + assert(!"Unexpected shader stage in _mesa_shader_stage_to_program"); + return GL_VERTEX_PROGRAM_ARB; +} + + static inline GLenum _mesa_program_index_to_target(GLuint i) { @@ -215,8 +233,8 @@ _mesa_program_index_to_target(GLuint i) GL_GEOMETRY_PROGRAM_NV, GL_FRAGMENT_PROGRAM_ARB }; - STATIC_ASSERT(Elements(enums) == MESA_SHADER_TYPES); - if(i >= MESA_SHADER_TYPES) { + STATIC_ASSERT(Elements(enums) == MESA_SHADER_STAGES); + if(i >= MESA_SHADER_STAGES) { assert(!"Unexpected program index"); return 0; } else diff --git a/mesalib/src/mesa/program/program_parse.y b/mesalib/src/mesa/program/program_parse.y index a76db4e86..6dde69d53 100644 --- a/mesalib/src/mesa/program/program_parse.y +++ b/mesalib/src/mesa/program/program_parse.y @@ -2707,10 +2707,10 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st state->st = _mesa_symbol_table_ctor(); state->limits = (target == GL_VERTEX_PROGRAM_ARB) - ? & ctx->Const.VertexProgram - : & ctx->Const.FragmentProgram; + ? & ctx->Const.Program[MESA_SHADER_VERTEX] + : & ctx->Const.Program[MESA_SHADER_FRAGMENT]; - state->MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits; + state->MaxTextureImageUnits = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits; state->MaxTextureUnits = ctx->Const.MaxTextureUnits; state->MaxClipPlanes = ctx->Const.MaxClipPlanes; diff --git a/mesalib/src/mesa/program/sampler.cpp b/mesalib/src/mesa/program/sampler.cpp index 9b9412730..e6532be84 100644 --- a/mesalib/src/mesa/program/sampler.cpp +++ b/mesalib/src/mesa/program/sampler.cpp @@ -111,7 +111,7 @@ _mesa_get_sampler_uniform_value(class ir_dereference *sampler, { get_sampler_name getname(sampler, shader_program); - GLuint shader = _mesa_program_target_to_index(prog->Target); + GLuint shader = _mesa_program_enum_to_shader_stage(prog->Target); sampler->accept(&getname); diff --git a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c index 51f079cda..a77fe54ae 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c @@ -65,12 +65,14 @@ update_framebuffer_state( struct st_context *st ) /* Examine Mesa's ctx->DrawBuffer->_ColorDrawBuffers state * to determine which surfaces to draw to */ - framebuffer->nr_cbufs = 0; + framebuffer->nr_cbufs = fb->_NumColorDrawBuffers; + for (i = 0; i < fb->_NumColorDrawBuffers; i++) { + pipe_surface_reference(&framebuffer->cbufs[i], NULL); + strb = st_renderbuffer(fb->_ColorDrawBuffers[i]); if (strb) { - /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/ if (strb->is_rtt || (strb->texture && util_format_is_srgb(strb->texture->format))) { /* rendering to a GL texture, may have to update surface */ @@ -78,13 +80,12 @@ update_framebuffer_state( struct st_context *st ) } if (strb->surface) { - pipe_surface_reference(&framebuffer->cbufs[framebuffer->nr_cbufs], - strb->surface); - framebuffer->nr_cbufs++; + pipe_surface_reference(&framebuffer->cbufs[i], strb->surface); } strb->defined = GL_TRUE; /* we'll be drawing something */ } } + for (i = framebuffer->nr_cbufs; i < PIPE_MAX_COLOR_BUFS; i++) { pipe_surface_reference(&framebuffer->cbufs[i], NULL); } @@ -113,7 +114,8 @@ update_framebuffer_state( struct st_context *st ) #ifdef DEBUG /* Make sure the resource binding flags were set properly */ for (i = 0; i < framebuffer->nr_cbufs; i++) { - assert(framebuffer->cbufs[i]->texture->bind & PIPE_BIND_RENDER_TARGET); + assert(!framebuffer->cbufs[i] || + framebuffer->cbufs[i]->texture->bind & PIPE_BIND_RENDER_TARGET); } if (framebuffer->zsbuf) { assert(framebuffer->zsbuf->texture->bind & PIPE_BIND_DEPTH_STENCIL); diff --git a/mesalib/src/mesa/state_tracker/st_atom_msaa.c b/mesalib/src/mesa/state_tracker/st_atom_msaa.c index fb760460c..2f3a42e02 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_msaa.c +++ b/mesalib/src/mesa/state_tracker/st_atom_msaa.c @@ -31,6 +31,7 @@ #include "st_atom.h" #include "cso_cache/cso_context.h" +#include "util/u_framebuffer.h" /* Second state atom for user clip planes: @@ -38,14 +39,9 @@ static void update_sample_mask( struct st_context *st ) { unsigned sample_mask = 0xffffffff; - unsigned sample_count = 1; struct pipe_framebuffer_state *framebuffer = &st->state.framebuffer; - /* dependency here on bound surface (or rather, sample count) is worrying */ - if (framebuffer->zsbuf) - sample_count = framebuffer->zsbuf->texture->nr_samples; - else if (framebuffer->cbufs[0]) - sample_count = framebuffer->cbufs[0]->texture->nr_samples; + unsigned sample_count = util_framebuffer_get_num_samples(framebuffer); if (st->ctx->Multisample.Enabled && sample_count > 1) { /* unlike in gallium/d3d10 the mask is only active if msaa is enabled */ diff --git a/mesalib/src/mesa/state_tracker/st_atom_sampler.c b/mesalib/src/mesa/state_tracker/st_atom_sampler.c index 57670ce25..cb5369bed 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_sampler.c +++ b/mesalib/src/mesa/state_tracker/st_atom_sampler.c @@ -279,14 +279,14 @@ update_samplers(struct st_context *st) update_shader_samplers(st, PIPE_SHADER_FRAGMENT, &ctx->FragmentProgram._Current->Base, - ctx->Const.FragmentProgram.MaxTextureImageUnits, + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, st->state.samplers[PIPE_SHADER_FRAGMENT], &st->state.num_samplers[PIPE_SHADER_FRAGMENT]); update_shader_samplers(st, PIPE_SHADER_VERTEX, &ctx->VertexProgram._Current->Base, - ctx->Const.VertexProgram.MaxTextureImageUnits, + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits, st->state.samplers[PIPE_SHADER_VERTEX], &st->state.num_samplers[PIPE_SHADER_VERTEX]); @@ -294,7 +294,7 @@ update_samplers(struct st_context *st) update_shader_samplers(st, PIPE_SHADER_GEOMETRY, &ctx->GeometryProgram._Current->Base, - ctx->Const.GeometryProgram.MaxTextureImageUnits, + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits, st->state.samplers[PIPE_SHADER_GEOMETRY], &st->state.num_samplers[PIPE_SHADER_GEOMETRY]); } diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c index bd0a22dde..7604202ba 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_texture.c +++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c @@ -326,11 +326,11 @@ update_vertex_textures(struct st_context *st) { const struct gl_context *ctx = st->ctx; - if (ctx->Const.VertexProgram.MaxTextureImageUnits > 0) { + if (ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits > 0) { update_textures(st, PIPE_SHADER_VERTEX, &ctx->VertexProgram._Current->Base, - ctx->Const.VertexProgram.MaxTextureImageUnits, + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits, st->state.sampler_views[PIPE_SHADER_VERTEX], &st->state.num_sampler_views[PIPE_SHADER_VERTEX]); } @@ -345,7 +345,7 @@ update_fragment_textures(struct st_context *st) update_textures(st, PIPE_SHADER_FRAGMENT, &ctx->FragmentProgram._Current->Base, - ctx->Const.FragmentProgram.MaxTextureImageUnits, + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, st->state.sampler_views[PIPE_SHADER_FRAGMENT], &st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]); } @@ -360,7 +360,7 @@ update_geometry_textures(struct st_context *st) update_textures(st, PIPE_SHADER_GEOMETRY, &ctx->GeometryProgram._Current->Base, - ctx->Const.FragmentProgram.MaxTextureImageUnits, + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, st->state.sampler_views[PIPE_SHADER_GEOMETRY], &st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]); } diff --git a/mesalib/src/mesa/state_tracker/st_cb_blit.c b/mesalib/src/mesa/state_tracker/st_cb_blit.c index a236a08e9..82c2e38e5 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_blit.c +++ b/mesalib/src/mesa/state_tracker/st_cb_blit.c @@ -44,6 +44,34 @@ static void +st_adjust_blit_for_msaa_resolve(struct pipe_blit_info *blit) +{ + /* Even though we do multisample resolves at the time of the blit, OpenGL + * specification defines them as if they happen at the time of rendering, + * which means that the type of averaging we do during the resolve should + * only depend on the source format; the destination format should be + * ignored. But, specification doesn't seem to be strict about it. + * + * It has been observed that mulitisample resolves produce slightly better + * looking images when averaging is done using destination format. NVIDIA's + * proprietary OpenGL driver also follows this approach. + * + * When multisampling, if the source and destination formats are equal + * (aside from the color space), we choose to blit in sRGB space to get + * this higher quality image. + */ + if (blit->src.resource->nr_samples > 1 && + blit->dst.resource->nr_samples <= 1) { + blit->dst.format = blit->dst.resource->format; + + if (util_format_is_srgb(blit->dst.resource->format)) + blit->src.format = util_format_srgb(blit->src.resource->format); + else + blit->src.format = util_format_linear(blit->src.resource->format); + } +} + +static void st_BlitFramebuffer(struct gl_context *ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, @@ -192,6 +220,8 @@ st_BlitFramebuffer(struct gl_context *ctx, blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace; blit.src.format = util_format_linear(srcObj->pt->format); + st_adjust_blit_for_msaa_resolve(&blit); + st->pipe->blit(st->pipe, &blit); } } @@ -227,6 +257,8 @@ st_BlitFramebuffer(struct gl_context *ctx, blit.src.box.z = srcSurf->u.tex.first_layer; blit.src.format = util_format_linear(srcSurf->format); + st_adjust_blit_for_msaa_resolve(&blit); + st->pipe->blit(st->pipe, &blit); } } diff --git a/mesalib/src/mesa/state_tracker/st_cb_clear.c b/mesalib/src/mesa/state_tracker/st_cb_clear.c index 887e58bd9..79124b3da 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_clear.c +++ b/mesalib/src/mesa/state_tracker/st_cb_clear.c @@ -399,6 +399,19 @@ is_color_masked(struct gl_context *ctx, int i) /** + * Return if all of the stencil bits are masked. + */ +static INLINE GLboolean +is_stencil_disabled(struct gl_context *ctx, struct gl_renderbuffer *rb) +{ + const GLuint stencilMax = 0xff; + + assert(_mesa_get_format_bits(rb->Format, GL_STENCIL_BITS) > 0); + return (ctx->Stencil.WriteMask[0] & stencilMax) == 0; +} + + +/** * Return if any of the stencil bits are masked. */ static INLINE GLboolean @@ -431,9 +444,9 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) if (mask & BUFFER_BITS_COLOR) { for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { - GLuint b = ctx->DrawBuffer->_ColorDrawBufferIndexes[i]; + GLint b = ctx->DrawBuffer->_ColorDrawBufferIndexes[i]; - if (mask & (1 << b)) { + if (b >= 0 && mask & (1 << b)) { struct gl_renderbuffer *rb = ctx->DrawBuffer->Attachment[b].Renderbuffer; struct st_renderbuffer *strb = st_renderbuffer(rb); @@ -457,7 +470,7 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) if (mask & BUFFER_BIT_DEPTH) { struct st_renderbuffer *strb = st_renderbuffer(depthRb); - if (strb->surface) { + if (strb->surface && ctx->Depth.Mask) { if (is_scissor_enabled(ctx, depthRb)) quad_buffers |= PIPE_CLEAR_DEPTH; else @@ -467,7 +480,7 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) if (mask & BUFFER_BIT_STENCIL) { struct st_renderbuffer *strb = st_renderbuffer(stencilRb); - if (strb->surface) { + if (strb->surface && !is_stencil_disabled(ctx, stencilRb)) { if (is_scissor_enabled(ctx, stencilRb) || is_stencil_masked(ctx, stencilRb)) quad_buffers |= PIPE_CLEAR_STENCIL; @@ -476,14 +489,23 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) } } - /* - * If we're going to use clear_with_quad() for any reason, use it for - * everything possible. + /* Always clear depth and stencil together. + * This can only happen when the stencil writemask is not a full mask. + */ + if (quad_buffers & PIPE_CLEAR_DEPTHSTENCIL && + clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) { + quad_buffers |= clear_buffers & PIPE_CLEAR_DEPTHSTENCIL; + clear_buffers &= ~PIPE_CLEAR_DEPTHSTENCIL; + } + + /* Only use quad-based clearing for the renderbuffers which cannot + * use pipe->clear. We want to always use pipe->clear for the other + * renderbuffers, because it's likely to be faster. */ if (quad_buffers) { - quad_buffers |= clear_buffers; clear_with_quad(ctx, quad_buffers); - } else if (clear_buffers) { + } + if (clear_buffers) { /* We can't translate the clear color to the colorbuffer format, * because different colorbuffers may have different formats. */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c index 70baa9965..daa94df92 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c @@ -680,7 +680,10 @@ st_DrawBuffers(struct gl_context *ctx, GLsizei count, const GLenum *buffers) /* add the renderbuffers on demand */ for (i = 0; i < fb->_NumColorDrawBuffers; i++) { gl_buffer_index idx = fb->_ColorDrawBufferIndexes[i]; - st_manager_add_color_renderbuffer(st, fb, idx); + + if (idx >= 0) { + st_manager_add_color_renderbuffer(st, fb, idx); + } } } diff --git a/mesalib/src/mesa/state_tracker/st_cb_viewport.c b/mesalib/src/mesa/state_tracker/st_cb_viewport.c index d654ed6e7..f0e97296f 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_viewport.c +++ b/mesalib/src/mesa/state_tracker/st_cb_viewport.c @@ -48,8 +48,7 @@ st_ws_framebuffer(struct gl_framebuffer *fb) return NULL; } -static void st_viewport(struct gl_context * ctx, GLint x, GLint y, - GLsizei width, GLsizei height) +static void st_viewport(struct gl_context *ctx) { struct st_context *st = ctx->st; struct st_framebuffer *stdraw; diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index 5e4a3b398..c17601a90 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -155,15 +155,15 @@ void st_init_limits(struct st_context *st) switch (sh) { case PIPE_SHADER_FRAGMENT: - pc = &c->FragmentProgram; + pc = &c->Program[MESA_SHADER_FRAGMENT]; options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT]; break; case PIPE_SHADER_VERTEX: - pc = &c->VertexProgram; + pc = &c->Program[MESA_SHADER_VERTEX]; options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX]; break; case PIPE_SHADER_GEOMETRY: - pc = &c->GeometryProgram; + pc = &c->Program[MESA_SHADER_GEOMETRY]; options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_GEOMETRY]; break; default: @@ -245,21 +245,21 @@ void st_init_limits(struct st_context *st) /* This depends on program constants. */ c->MaxTextureCoordUnits - = _min(c->FragmentProgram.MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS); + = _min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS); - c->MaxTextureUnits = _min(c->FragmentProgram.MaxTextureImageUnits, c->MaxTextureCoordUnits); + c->MaxTextureUnits = _min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, c->MaxTextureCoordUnits); - c->VertexProgram.MaxAttribs = MIN2(c->VertexProgram.MaxAttribs, 16); + c->Program[MESA_SHADER_VERTEX].MaxAttribs = MIN2(c->Program[MESA_SHADER_VERTEX].MaxAttribs, 16); /* PIPE_SHADER_CAP_MAX_INPUTS for the FS specifies the maximum number * of inputs. It's always 2 colors + N generic inputs. */ c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS); c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING); - c->FragmentProgram.MaxInputComponents = c->MaxVarying * 4; - c->VertexProgram.MaxOutputComponents = c->MaxVarying * 4; - c->GeometryProgram.MaxInputComponents = c->MaxVarying * 4; - c->GeometryProgram.MaxOutputComponents = c->MaxVarying * 4; + c->Program[MESA_SHADER_FRAGMENT].MaxInputComponents = c->MaxVarying * 4; + c->Program[MESA_SHADER_VERTEX].MaxOutputComponents = c->MaxVarying * 4; + c->Program[MESA_SHADER_GEOMETRY].MaxInputComponents = c->MaxVarying * 4; + c->Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = c->MaxVarying * 4; c->MinProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXEL_OFFSET); c->MaxProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET); @@ -284,9 +284,9 @@ void st_init_limits(struct st_context *st) c->UniformBufferOffsetAlignment = screen->get_param(screen, PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT); c->MaxCombinedUniformBlocks = c->MaxUniformBufferBindings = - c->VertexProgram.MaxUniformBlocks + - c->GeometryProgram.MaxUniformBlocks + - c->FragmentProgram.MaxUniformBlocks; + c->Program[MESA_SHADER_VERTEX].MaxUniformBlocks + + c->Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks + + c->Program[MESA_SHADER_FRAGMENT].MaxUniformBlocks; assert(c->MaxCombinedUniformBlocks <= MAX_COMBINED_UNIFORM_BUFFERS); } } diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index eb12426a5..f1b354429 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -897,8 +897,8 @@ glsl_to_tgsi_visitor::add_constant(gl_register_file file, /* Search immediate storage to see if we already have an identical * immediate that we can use instead of adding a duplicate entry. */ - foreach_iter(exec_list_iterator, iter, this->immediates) { - entry = (immediate_storage *)iter.get(); + foreach_list(node, &this->immediates) { + entry = (immediate_storage *) node; if (entry->size == size && entry->type == datatype && @@ -1040,8 +1040,8 @@ glsl_to_tgsi_visitor::find_variable_storage(ir_variable *var) variable_storage *entry; - foreach_iter(exec_list_iterator, iter, this->variables) { - entry = (variable_storage *)iter.get(); + foreach_list(node, &this->variables) { + entry = (variable_storage *) node; if (entry->var == var) return entry; @@ -1179,8 +1179,8 @@ glsl_to_tgsi_visitor::visit(ir_function *ir) assert(sig); - foreach_iter(exec_list_iterator, iter, sig->body) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(node, &sig->body) { + ir_instruction *ir = (ir_instruction *) node; ir->accept(this); } @@ -2455,8 +2455,8 @@ glsl_to_tgsi_visitor::visit(ir_constant *ir) st_src_reg temp_base = get_temp(ir->type); st_dst_reg temp = st_dst_reg(temp_base); - foreach_iter(exec_list_iterator, iter, ir->components) { - ir_constant *field_value = (ir_constant *)iter.get(); + foreach_list(node, &ir->components) { + ir_constant *field_value = (ir_constant *) node; int size = type_size(field_value->type); assert(size > 0); @@ -2572,8 +2572,8 @@ glsl_to_tgsi_visitor::get_function_signature(ir_function_signature *sig) { function_entry *entry; - foreach_iter(exec_list_iterator, iter, this->function_signatures) { - entry = (function_entry *)iter.get(); + foreach_list(node, &this->function_signatures) { + entry = (function_entry *) node; if (entry->sig == sig) return entry; @@ -2585,8 +2585,8 @@ glsl_to_tgsi_visitor::get_function_signature(ir_function_signature *sig) entry->bgn_inst = NULL; /* Allocate storage for all the parameters. */ - foreach_iter(exec_list_iterator, iter, sig->parameters) { - ir_variable *param = (ir_variable *)iter.get(); + foreach_list(node, &sig->parameters) { + ir_variable *param = (ir_variable *) node; variable_storage *storage; storage = find_variable_storage(param); @@ -2617,10 +2617,10 @@ glsl_to_tgsi_visitor::visit(ir_call *ir) int i; /* Process in parameters. */ - exec_list_iterator sig_iter = sig->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param_rval = (ir_rvalue *)iter.get(); - ir_variable *param = (ir_variable *)sig_iter.get(); + foreach_two_lists(formal_node, &sig->parameters, + actual_node, &ir->actual_parameters) { + ir_rvalue *param_rval = (ir_rvalue *) actual_node; + ir_variable *param = (ir_variable *) formal_node; if (param->data.mode == ir_var_function_in || param->data.mode == ir_var_function_inout) { @@ -2643,20 +2643,17 @@ glsl_to_tgsi_visitor::visit(ir_call *ir) r.index++; } } - - sig_iter.next(); } - assert(!sig_iter.has_next()); /* Emit call instruction */ call_inst = emit(ir, TGSI_OPCODE_CAL); call_inst->function = entry; /* Process out parameters. */ - sig_iter = sig->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param_rval = (ir_rvalue *)iter.get(); - ir_variable *param = (ir_variable *)sig_iter.get(); + foreach_two_lists(formal_node, &sig->parameters, + actual_node, &ir->actual_parameters) { + ir_rvalue *param_rval = (ir_rvalue *) actual_node; + ir_variable *param = (ir_variable *) formal_node; if (param->data.mode == ir_var_function_out || param->data.mode == ir_var_function_inout) { @@ -2679,10 +2676,7 @@ glsl_to_tgsi_visitor::visit(ir_call *ir) r.index++; } } - - sig_iter.next(); } - assert(!sig_iter.has_next()); /* Process return value. */ this->result = entry->return_reg; @@ -3070,8 +3064,8 @@ count_resources(glsl_to_tgsi_visitor *v, gl_program *prog) { v->samplers_used = 0; - foreach_iter(exec_list_iterator, iter, v->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &v->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; if (is_tex_instruction(inst->op)) { v->samplers_used |= 1 << inst->sampler; @@ -3216,8 +3210,8 @@ glsl_to_tgsi_visitor::simplify_cmp(void) memset(tempWrites, 0, sizeof(unsigned) * MAX_TEMPS); memset(outputWrites, 0, sizeof(outputWrites)); - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; unsigned prevWriteMask = 0; /* Give up if we encounter relative addressing or flow control. */ @@ -3262,8 +3256,8 @@ glsl_to_tgsi_visitor::simplify_cmp(void) void glsl_to_tgsi_visitor::rename_temp_register(int index, int new_index) { - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; unsigned j; for (j=0; j < num_inst_src_regs(inst->op); j++) { @@ -3286,8 +3280,8 @@ glsl_to_tgsi_visitor::get_first_temp_read(int index) int loop_start = -1; /* index of the first active BGNLOOP (if any) */ unsigned i = 0, j; - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; for (j=0; j < num_inst_src_regs(inst->op); j++) { if (inst->src[j].file == PROGRAM_TEMPORARY && @@ -3318,8 +3312,8 @@ glsl_to_tgsi_visitor::get_first_temp_write(int index) int loop_start = -1; /* index of the first active BGNLOOP (if any) */ int i = 0; - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; if (inst->dst.file == PROGRAM_TEMPORARY && inst->dst.index == index) { return (depth == 0) ? i : loop_start; @@ -3347,8 +3341,8 @@ glsl_to_tgsi_visitor::get_last_temp_read(int index) int last = -1; /* index of last instruction that reads the temporary */ unsigned i = 0, j; - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; for (j=0; j < num_inst_src_regs(inst->op); j++) { if (inst->src[j].file == PROGRAM_TEMPORARY && @@ -3378,8 +3372,8 @@ glsl_to_tgsi_visitor::get_last_temp_write(int index) int last = -1; /* index of last instruction that writes to the temporary */ int i = 0; - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; if (inst->dst.file == PROGRAM_TEMPORARY && inst->dst.index == index) last = (depth == 0) ? i : -2; @@ -3427,8 +3421,8 @@ glsl_to_tgsi_visitor::copy_propagate(void) int *acp_level = rzalloc_array(mem_ctx, int, this->next_temp * 4); int level = 0; - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; assert(inst->dst.file != PROGRAM_TEMPORARY || inst->dst.index < this->next_temp); @@ -3624,13 +3618,13 @@ glsl_to_tgsi_visitor::eliminate_dead_code(void) int last_read = get_last_temp_read(i); int j = 0; - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list_safe(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; if (inst->dst.file == PROGRAM_TEMPORARY && inst->dst.index == i && j > last_read) { - iter.remove(); + inst->remove(); delete inst; } @@ -3661,8 +3655,8 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void) int level = 0; int removed = 0; - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; assert(inst->dst.file != PROGRAM_TEMPORARY || inst->dst.index < this->next_temp); @@ -3769,13 +3763,13 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void) /* Now actually remove the instructions that are completely dead and update * the writemask of other instructions with dead channels. */ - foreach_iter(exec_list_iterator, iter, this->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list_safe(node, &this->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; if (!inst->dead_mask || !inst->dst.writemask) continue; else if ((inst->dst.writemask & ~inst->dead_mask) == 0) { - iter.remove(); + inst->remove(); delete inst; removed++; } else @@ -3956,8 +3950,8 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp, /* Now copy the instructions from the original glsl_to_tgsi_visitor into the * new visitor. */ - foreach_iter(exec_list_iterator, iter, original->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &original->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; glsl_to_tgsi_instruction *newinst; st_src_reg src_regs[3]; @@ -4040,8 +4034,8 @@ get_bitmap_visitor(struct st_fragment_program *fp, /* Now copy the instructions from the original glsl_to_tgsi_visitor into the * new visitor. */ - foreach_iter(exec_list_iterator, iter, original->instructions) { - glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get(); + foreach_list(node, &original->instructions) { + glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *) node; glsl_to_tgsi_instruction *newinst; st_src_reg src_regs[3]; @@ -4962,15 +4956,15 @@ st_translate_program( goto out; } i = 0; - foreach_iter(exec_list_iterator, iter, program->immediates) { - immediate_storage *imm = (immediate_storage *)iter.get(); + foreach_list(node, &program->immediates) { + immediate_storage *imm = (immediate_storage *) node; assert(i < program->num_immediates); t->immediates[i++] = emit_immediate(t, imm->values, imm->type, imm->size); } assert(i == program->num_immediates); /* texture samplers */ - for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) { if (program->samplers_used & (1 << i)) { t->samplers[i] = ureg_DECL_sampler(ureg, i); } @@ -4978,10 +4972,9 @@ st_translate_program( /* Emit each instruction in turn: */ - foreach_iter(exec_list_iterator, iter, program->instructions) { + foreach_list(n, &program->instructions) { set_insn_start(t, ureg_get_instruction_number(ureg)); - compile_tgsi_instruction(t, (glsl_to_tgsi_instruction *)iter.get(), - clamp_color); + compile_tgsi_instruction(t, (glsl_to_tgsi_instruction *) n, clamp_color); } /* Fix up all emitted labels: @@ -4996,7 +4989,7 @@ st_translate_program( * prog->ParameterValues to get reallocated (e.g., anything that adds a * program constant) has to happen before creating this linkage. */ - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (program->shader_program->_LinkedShaders[i] == NULL) continue; @@ -5023,6 +5016,24 @@ out: } /* ----------------------------- End TGSI code ------------------------------ */ + +static unsigned +shader_stage_to_ptarget(gl_shader_stage stage) +{ + switch (stage) { + case MESA_SHADER_VERTEX: + return PIPE_SHADER_VERTEX; + case MESA_SHADER_FRAGMENT: + return PIPE_SHADER_FRAGMENT; + case MESA_SHADER_GEOMETRY: + return PIPE_SHADER_GEOMETRY; + } + + assert(!"should not be reached"); + return PIPE_SHADER_VERTEX; +} + + /** * Convert a shader's GLSL IR into a Mesa gl_program, although without * generating Mesa IR. @@ -5034,30 +5045,12 @@ get_mesa_program(struct gl_context *ctx, { glsl_to_tgsi_visitor* v; struct gl_program *prog; - GLenum target; + GLenum target = _mesa_shader_stage_to_program(shader->Stage); bool progress; struct gl_shader_compiler_options *options = - &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)]; + &ctx->ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(shader->Type)]; struct pipe_screen *pscreen = ctx->st->pipe->screen; - unsigned ptarget; - - switch (shader->Type) { - case GL_VERTEX_SHADER: - target = GL_VERTEX_PROGRAM_ARB; - ptarget = PIPE_SHADER_VERTEX; - break; - case GL_FRAGMENT_SHADER: - target = GL_FRAGMENT_PROGRAM_ARB; - ptarget = PIPE_SHADER_FRAGMENT; - break; - case GL_GEOMETRY_SHADER: - target = GL_GEOMETRY_PROGRAM_NV; - ptarget = PIPE_SHADER_GEOMETRY; - break; - default: - assert(!"should not be reached"); - return NULL; - } + unsigned ptarget = shader_stage_to_ptarget(shader->Stage); validate_ir_tree(shader->ir); @@ -5089,8 +5082,8 @@ get_mesa_program(struct gl_context *ctx, do { progress = GL_FALSE; - foreach_iter(exec_list_iterator, iter, v->function_signatures) { - function_entry *entry = (function_entry *)iter.get(); + foreach_list(node, &v->function_signatures) { + function_entry *entry = (function_entry *) node; if (!entry->bgn_inst) { v->current_function = entry; @@ -5143,7 +5136,7 @@ get_mesa_program(struct gl_context *ctx, if (ctx->Shader.Flags & GLSL_DUMP) { printf("\n"); printf("GLSL IR for linked %s program %d:\n", - _mesa_shader_enum_to_string(shader->Type), + _mesa_shader_stage_to_string(shader->Stage), shader_program->Name); _mesa_print_ir(shader->ir, NULL); printf("\n"); @@ -5154,7 +5147,7 @@ get_mesa_program(struct gl_context *ctx, prog->Instructions = NULL; prog->NumInstructions = 0; - do_set_program_inouts(shader->ir, prog, shader->Type); + do_set_program_inouts(shader->ir, prog, shader->Stage); count_resources(v, prog); _mesa_reference_program(ctx, &shader->Program, prog); @@ -5207,6 +5200,7 @@ st_new_shader(struct gl_context *ctx, GLuint name, GLuint type) shader = rzalloc(NULL, struct gl_shader); if (shader) { shader->Type = type; + shader->Stage = _mesa_shader_enum_to_shader_stage(type); shader->Name = name; _mesa_init_shader(ctx, shader); } @@ -5236,14 +5230,14 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) { assert(prog->LinkStatus); - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; bool progress; exec_list *ir = prog->_LinkedShaders[i]->ir; const struct gl_shader_compiler_options *options = - &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(prog->_LinkedShaders[i]->Type)]; + &ctx->ShaderCompilerOptions[_mesa_shader_enum_to_shader_stage(prog->_LinkedShaders[i]->Type)]; /* If there are forms of indirect addressing that the driver * cannot handle, perform the lowering pass. @@ -5306,7 +5300,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) validate_ir_tree(ir); } - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_program *linked_prog; if (prog->_LinkedShaders[i] == NULL) diff --git a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c index 1c2abc122..aa9ec1359 100644 --- a/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -1225,7 +1225,7 @@ st_translate_mesa_program( } /* texture samplers */ - for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) { + for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; i++) { if (program->SamplersUsed & (1 << i)) { t->samplers[i] = ureg_DECL_sampler( ureg, i ); } diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c index 8934088df..fdf9b370a 100644 --- a/mesalib/src/mesa/swrast/s_context.c +++ b/mesalib/src/mesa/swrast/s_context.c @@ -794,9 +794,9 @@ _swrast_CreateContext( struct gl_context *ctx ) swrast->PointSpan.facing = 0; swrast->PointSpan.array = swrast->SpanArrays; - init_program_native_limits(&ctx->Const.VertexProgram); - init_program_native_limits(&ctx->Const.GeometryProgram); - init_program_native_limits(&ctx->Const.FragmentProgram); + init_program_native_limits(&ctx->Const.Program[MESA_SHADER_VERTEX]); + init_program_native_limits(&ctx->Const.Program[MESA_SHADER_GEOMETRY]); + init_program_native_limits(&ctx->Const.Program[MESA_SHADER_FRAGMENT]); ctx->swrast_context = swrast; diff --git a/mesalib/src/mesa/swrast/s_texcombine.c b/mesalib/src/mesa/swrast/s_texcombine.c index 7e07f4f8a..32d7c0944 100644 --- a/mesalib/src/mesa/swrast/s_texcombine.c +++ b/mesalib/src/mesa/swrast/s_texcombine.c @@ -602,6 +602,14 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span ) if (!swrast->TexelBuffer) { #ifdef _OPENMP const GLint maxThreads = omp_get_max_threads(); + + /* TexelBuffer memory allocation needs to be done in a critical section + * as this code runs in a parallel loop. + * When entering the section, first check if TexelBuffer has been + * initialized already by another thread while this thread was waiting. + */ + #pragma omp critical + if (!swrast->TexelBuffer) { #else const GLint maxThreads = 1; #endif @@ -611,8 +619,12 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span ) * thread. */ swrast->TexelBuffer = - malloc(ctx->Const.FragmentProgram.MaxTextureImageUnits * maxThreads * + malloc(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits * maxThreads * SWRAST_MAX_WIDTH * 4 * sizeof(GLfloat)); +#ifdef _OPENMP + } /* critical section */ +#endif + if (!swrast->TexelBuffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine"); return; diff --git a/mesalib/src/mesa/swrast/s_texfetch.c b/mesalib/src/mesa/swrast/s_texfetch.c index 0196aede1..b886e6586 100644 --- a/mesalib/src/mesa/swrast/s_texfetch.c +++ b/mesalib/src/mesa/swrast/s_texfetch.c @@ -1286,6 +1286,24 @@ texfetch_funcs[] = NULL, NULL }, + { + MESA_FORMAT_ABGR2101010, + NULL, + NULL, + NULL + }, + { + MESA_FORMAT_SIGNED_RG88, + NULL, + NULL, + NULL + }, + { + MESA_FORMAT_SIGNED_RG1616, + NULL, + NULL, + NULL + }, }; diff --git a/mesalib/src/mesa/tnl/t_vb_program.c b/mesalib/src/mesa/tnl/t_vb_program.c index e43d5d9eb..d08abe7c2 100644 --- a/mesalib/src/mesa/tnl/t_vb_program.c +++ b/mesalib/src/mesa/tnl/t_vb_program.c @@ -259,7 +259,7 @@ map_textures(struct gl_context *ctx, const struct gl_vertex_program *vp) { GLuint u; - for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) { + for (u = 0; u < ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits; u++) { if (vp->Base.TexturesUsed[u]) { /* Note: _Current *should* correspond to the target indicated * in TexturesUsed[u]. @@ -278,7 +278,7 @@ unmap_textures(struct gl_context *ctx, const struct gl_vertex_program *vp) { GLuint u; - for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) { + for (u = 0; u < ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits; u++) { if (vp->Base.TexturesUsed[u]) { /* Note: _Current *should* correspond to the target indicated * in TexturesUsed[u]. diff --git a/xorg-server/Xext/dpmsproc.h b/xorg-server/Xext/dpmsproc.h index 7494dfd6f..82dccbd67 100644 --- a/xorg-server/Xext/dpmsproc.h +++ b/xorg-server/Xext/dpmsproc.h @@ -9,7 +9,7 @@ #include "dixstruct.h" -int DPMSSet(ClientPtr client, int level); -Bool DPMSSupported(void); +int _X_EXPORT DPMSSet(ClientPtr client, int level); +Bool _X_EXPORT DPMSSupported(void); #endif diff --git a/xorg-server/Xext/geext.c b/xorg-server/Xext/geext.c index f96b76468..b4e336110 100644 --- a/xorg-server/Xext/geext.c +++ b/xorg-server/Xext/geext.c @@ -148,7 +148,7 @@ SProcGEDispatch(ClientPtr client) * used in the furture for versioning support. */ static void -GEClientCallback(CallbackListPtr *list, pointer closure, pointer data) +GEClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; diff --git a/xorg-server/Xext/hashtable.c b/xorg-server/Xext/hashtable.c index e362ad12f..f10ca769d 100644 --- a/xorg-server/Xext/hashtable.c +++ b/xorg-server/Xext/hashtable.c @@ -23,7 +23,7 @@ struct HashTableRec { HashFunc hash; HashCompareFunc compare; - pointer cdata; + void *cdata; }; typedef struct { @@ -37,7 +37,7 @@ ht_create(int keySize, int dataSize, HashFunc hash, HashCompareFunc compare, - pointer cdata) + void *cdata) { int c; int numBuckets; @@ -117,8 +117,8 @@ double_size(HashTable ht) } } -pointer -ht_add(HashTable ht, pointer key) +void * +ht_add(HashTable ht, const void *key) { unsigned index = ht->hash(ht->cdata, key, ht->bucketBits); struct xorg_list *bucket = &ht->buckets[index]; @@ -164,7 +164,7 @@ ht_add(HashTable ht, pointer key) } void -ht_remove(HashTable ht, pointer key) +ht_remove(HashTable ht, const void *key) { unsigned index = ht->hash(ht->cdata, key, ht->bucketBits); struct xorg_list *bucket = &ht->buckets[index]; @@ -182,8 +182,8 @@ ht_remove(HashTable ht, pointer key) } } -pointer -ht_find(HashTable ht, pointer key) +void * +ht_find(HashTable ht, const void *key) { unsigned index = ht->hash(ht->cdata, key, ht->bucketBits); struct xorg_list *bucket = &ht->buckets[index]; diff --git a/xorg-server/Xext/hashtable.h b/xorg-server/Xext/hashtable.h index 5d1598425..a988af32c 100644 --- a/xorg-server/Xext/hashtable.h +++ b/xorg-server/Xext/hashtable.h @@ -55,7 +55,7 @@ extern _X_EXPORT HashTable ht_create(int keySize, int dataSize, HashFunc hash, HashCompareFunc compare, - pointer cdata); + void *cdata); /** @brief HtDestruct deinitializes the structure. It does not free the memory allocated to HashTableRec */ @@ -75,12 +75,12 @@ extern _X_EXPORT void ht_destroy(HashTable ht); to avoid returning NULL. Obviously the data pointed cannot be modified, as implied by dataSize being 0. */ -extern _X_EXPORT pointer ht_add(HashTable ht, pointer key); +extern _X_EXPORT void *ht_add(HashTable ht, const void *key); /** @brief Removes a key from the hash table along with its associated data, which will be free'd. */ -extern _X_EXPORT void ht_remove(HashTable ht, pointer key); +extern _X_EXPORT void ht_remove(HashTable ht, const void *key); /** @brief Finds the associated data of a key from the hash table. @@ -93,7 +93,7 @@ extern _X_EXPORT void ht_remove(HashTable ht, pointer key); use HtMember instead to determine if a key has been inserted. */ -extern _X_EXPORT pointer ht_find(HashTable ht, pointer key); +extern _X_EXPORT void *ht_find(HashTable ht, const void *key); /** @brief A generic hash function */ extern _X_EXPORT unsigned ht_generic_hash(void *cdata, diff --git a/xorg-server/Xext/panoramiX.c b/xorg-server/Xext/panoramiX.c index 4b82200ec..a64951a6d 100644 --- a/xorg-server/Xext/panoramiX.c +++ b/xorg-server/Xext/panoramiX.c @@ -118,7 +118,7 @@ static DevPrivateKeyRec PanoramiXScreenKeyRec; typedef struct { DDXPointRec clipOrg; DDXPointRec patOrg; - GCFuncs *wrapFuncs; + const GCFuncs *wrapFuncs; } PanoramiXGCRec, *PanoramiXGCPtr; typedef struct { @@ -130,11 +130,11 @@ static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr); static void XineramaChangeGC(GCPtr, unsigned long); static void XineramaCopyGC(GCPtr, unsigned long, GCPtr); static void XineramaDestroyGC(GCPtr); -static void XineramaChangeClip(GCPtr, int, pointer, int); +static void XineramaChangeClip(GCPtr, int, void *, int); static void XineramaDestroyClip(GCPtr); static void XineramaCopyClip(GCPtr, GCPtr); -static GCFuncs XineramaGCFuncs = { +static const GCFuncs XineramaGCFuncs = { XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC, XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip }; @@ -160,7 +160,7 @@ XineramaCloseScreen(ScreenPtr pScreen) if (pScreen->myNum == 0) RegionUninit(&PanoramiXScreenRegion); - free((pointer) pScreenPriv); + free(pScreenPriv); return (*pScreen->CloseScreen) (pScreen); } @@ -294,7 +294,7 @@ XineramaCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) } static void -XineramaChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +XineramaChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { Xinerama_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); @@ -318,7 +318,7 @@ XineramaDestroyClip(GCPtr pGC) } int -XineramaDeleteResource(pointer data, XID id) +XineramaDeleteResource(void *data, XID id) { free(data); return 1; @@ -330,7 +330,7 @@ typedef struct { } PanoramiXSearchData; static Bool -XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata) +XineramaFindIDByScrnum(void *resource, XID id, void *privdata) { PanoramiXRes *res = (PanoramiXRes *) resource; PanoramiXSearchData *data = (PanoramiXSearchData *) privdata; @@ -342,7 +342,7 @@ PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen) { PanoramiXSearchData data; - pointer val; + void *val; if (!screen) { dixLookupResourceByType(&val, id, type, serverClient, DixReadAccess); @@ -691,9 +691,9 @@ PanoramiXCreateConnectionBlock(void) root->mmHeight *= height_mult; while (ConnectionCallbackList) { - pointer tmp; + void *tmp; - tmp = (pointer) ConnectionCallbackList; + tmp = (void *) ConnectionCallbackList; (*ConnectionCallbackList->func) (); ConnectionCallbackList = ConnectionCallbackList->next; free(tmp); diff --git a/xorg-server/Xext/panoramiXprocs.c b/xorg-server/Xext/panoramiXprocs.c index 1a855fe08..87a2a176c 100644 --- a/xorg-server/Xext/panoramiXprocs.c +++ b/xorg-server/Xext/panoramiXprocs.c @@ -72,7 +72,7 @@ PanoramiXCreateWindow(ClientPtr client) if (Ones(stuff->mask) != len) return BadLength; - result = dixLookupResourceByType((pointer *) &parent, stuff->parent, + result = dixLookupResourceByType((void **) &parent, stuff->parent, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; @@ -87,7 +87,7 @@ PanoramiXCreateWindow(ClientPtr client) pback_offset = Ones((Mask) stuff->mask & (CWBackPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { - result = dixLookupResourceByType((pointer *) &backPix, tmp, + result = dixLookupResourceByType((void **) &backPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -97,7 +97,7 @@ PanoramiXCreateWindow(ClientPtr client) pbord_offset = Ones((Mask) stuff->mask & (CWBorderPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { - result = dixLookupResourceByType((pointer *) &bordPix, tmp, + result = dixLookupResourceByType((void **) &bordPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -107,7 +107,7 @@ PanoramiXCreateWindow(ClientPtr client) cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1)); tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { - result = dixLookupResourceByType((pointer *) &cmap, tmp, + result = dixLookupResourceByType((void **) &cmap, tmp, XRT_COLORMAP, client, DixReadAccess); if (result != Success) @@ -178,7 +178,7 @@ PanoramiXChangeWindowAttributes(ClientPtr client) if (Ones(stuff->valueMask) != len) return BadLength; - result = dixLookupResourceByType((pointer *) &win, stuff->window, + result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; @@ -191,7 +191,7 @@ PanoramiXChangeWindowAttributes(ClientPtr client) pback_offset = Ones((Mask) stuff->valueMask & (CWBackPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { - result = dixLookupResourceByType((pointer *) &backPix, tmp, + result = dixLookupResourceByType((void **) &backPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -201,7 +201,7 @@ PanoramiXChangeWindowAttributes(ClientPtr client) pbord_offset = Ones((Mask) stuff->valueMask & (CWBorderPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { - result = dixLookupResourceByType((pointer *) &bordPix, tmp, + result = dixLookupResourceByType((void **) &bordPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -211,7 +211,7 @@ PanoramiXChangeWindowAttributes(ClientPtr client) cmap_offset = Ones((Mask) stuff->valueMask & (CWColormap - 1)); tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { - result = dixLookupResourceByType((pointer *) &cmap, tmp, + result = dixLookupResourceByType((void **) &cmap, tmp, XRT_COLORMAP, client, DixReadAccess); if (result != Success) @@ -243,7 +243,7 @@ PanoramiXDestroyWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); - result = dixLookupResourceByType((pointer *) &win, stuff->id, XRT_WINDOW, + result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixDestroyAccess); if (result != Success) return result; @@ -271,7 +271,7 @@ PanoramiXDestroySubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); - result = dixLookupResourceByType((pointer *) &win, stuff->id, XRT_WINDOW, + result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixDestroyAccess); if (result != Success) return result; @@ -299,7 +299,7 @@ PanoramiXChangeSaveSet(ClientPtr client) REQUEST_SIZE_MATCH(xChangeSaveSetReq); - result = dixLookupResourceByType((pointer *) &win, stuff->window, + result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; @@ -326,12 +326,12 @@ PanoramiXReparentWindow(ClientPtr client) REQUEST_SIZE_MATCH(xReparentWindowReq); - result = dixLookupResourceByType((pointer *) &win, stuff->window, + result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; - result = dixLookupResourceByType((pointer *) &parent, stuff->parent, + result = dixLookupResourceByType((void **) &parent, stuff->parent, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; @@ -365,7 +365,7 @@ PanoramiXMapWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); - result = dixLookupResourceByType((pointer *) &win, stuff->id, + result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; @@ -390,7 +390,7 @@ PanoramiXMapSubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); - result = dixLookupResourceByType((pointer *) &win, stuff->id, + result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; @@ -415,7 +415,7 @@ PanoramiXUnmapWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); - result = dixLookupResourceByType((pointer *) &win, stuff->id, + result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; @@ -440,7 +440,7 @@ PanoramiXUnmapSubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); - result = dixLookupResourceByType((pointer *) &win, stuff->id, + result = dixLookupResourceByType((void **) &win, stuff->id, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; @@ -474,12 +474,12 @@ PanoramiXConfigureWindow(ClientPtr client) return BadLength; /* because we need the parent */ - result = dixLookupResourceByType((pointer *) &pWin, stuff->window, + result = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixWriteAccess); if (result != Success) return result; - result = dixLookupResourceByType((pointer *) &win, stuff->window, + result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; @@ -489,7 +489,7 @@ PanoramiXConfigureWindow(ClientPtr client) sib_offset = Ones((Mask) stuff->mask & (CWSibling - 1)); if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) { - result = dixLookupResourceByType((pointer *) &sib, tmp, XRT_WINDOW, + result = dixLookupResourceByType((void **) &sib, tmp, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; @@ -537,7 +537,7 @@ PanoramiXCirculateWindow(ClientPtr client) REQUEST_SIZE_MATCH(xCirculateWindowReq); - result = dixLookupResourceByType((pointer *) &win, stuff->window, + result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; @@ -685,7 +685,7 @@ PanoramiXCreatePixmap(ClientPtr client) REQUEST_SIZE_MATCH(xCreatePixmapReq); client->errorValue = stuff->pid; - result = dixLookupResourceByClass((pointer *) &refDraw, stuff->drawable, + result = dixLookupResourceByClass((void **) &refDraw, stuff->drawable, XRC_DRAWABLE, client, DixReadAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -725,7 +725,7 @@ PanoramiXFreePixmap(ClientPtr client) client->errorValue = stuff->id; - result = dixLookupResourceByType((pointer *) &pix, stuff->id, XRT_PIXMAP, + result = dixLookupResourceByType((void **) &pix, stuff->id, XRT_PIXMAP, client, DixDestroyAccess); if (result != Success) return result; @@ -764,7 +764,7 @@ PanoramiXCreateGC(ClientPtr client) if (Ones(stuff->mask) != len) return BadLength; - result = dixLookupResourceByClass((pointer *) &refDraw, stuff->drawable, + result = dixLookupResourceByClass((void **) &refDraw, stuff->drawable, XRC_DRAWABLE, client, DixReadAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -772,7 +772,7 @@ PanoramiXCreateGC(ClientPtr client) if ((Mask) stuff->mask & GCTile) { tile_offset = Ones((Mask) stuff->mask & (GCTile - 1)); if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { - result = dixLookupResourceByType((pointer *) &tile, tmp, XRT_PIXMAP, + result = dixLookupResourceByType((void **) &tile, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -781,7 +781,7 @@ PanoramiXCreateGC(ClientPtr client) if ((Mask) stuff->mask & GCStipple) { stip_offset = Ones((Mask) stuff->mask & (GCStipple - 1)); if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { - result = dixLookupResourceByType((pointer *) &stip, tmp, XRT_PIXMAP, + result = dixLookupResourceByType((void **) &stip, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -790,7 +790,7 @@ PanoramiXCreateGC(ClientPtr client) if ((Mask) stuff->mask & GCClipMask) { clip_offset = Ones((Mask) stuff->mask & (GCClipMask - 1)); if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { - result = dixLookupResourceByType((pointer *) &clip, tmp, XRT_PIXMAP, + result = dixLookupResourceByType((void **) &clip, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -844,7 +844,7 @@ PanoramiXChangeGC(ClientPtr client) if (Ones(stuff->mask) != len) return BadLength; - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -852,7 +852,7 @@ PanoramiXChangeGC(ClientPtr client) if ((Mask) stuff->mask & GCTile) { tile_offset = Ones((Mask) stuff->mask & (GCTile - 1)); if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { - result = dixLookupResourceByType((pointer *) &tile, tmp, XRT_PIXMAP, + result = dixLookupResourceByType((void **) &tile, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -861,7 +861,7 @@ PanoramiXChangeGC(ClientPtr client) if ((Mask) stuff->mask & GCStipple) { stip_offset = Ones((Mask) stuff->mask & (GCStipple - 1)); if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { - result = dixLookupResourceByType((pointer *) &stip, tmp, XRT_PIXMAP, + result = dixLookupResourceByType((void **) &stip, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -870,7 +870,7 @@ PanoramiXChangeGC(ClientPtr client) if ((Mask) stuff->mask & GCClipMask) { clip_offset = Ones((Mask) stuff->mask & (GCClipMask - 1)); if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { - result = dixLookupResourceByType((pointer *) &clip, tmp, XRT_PIXMAP, + result = dixLookupResourceByType((void **) &clip, tmp, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -903,12 +903,12 @@ PanoramiXCopyGC(ClientPtr client) REQUEST_SIZE_MATCH(xCopyGCReq); - result = dixLookupResourceByType((pointer *) &srcGC, stuff->srcGC, XRT_GC, + result = dixLookupResourceByType((void **) &srcGC, stuff->srcGC, XRT_GC, client, DixReadAccess); if (result != Success) return result; - result = dixLookupResourceByType((pointer *) &dstGC, stuff->dstGC, XRT_GC, + result = dixLookupResourceByType((void **) &dstGC, stuff->dstGC, XRT_GC, client, DixWriteAccess); if (result != Success) return result; @@ -934,7 +934,7 @@ PanoramiXSetDashes(ClientPtr client) REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixWriteAccess); if (result != Success) return result; @@ -959,7 +959,7 @@ PanoramiXSetClipRectangles(ClientPtr client) REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixWriteAccess); if (result != Success) return result; @@ -984,7 +984,7 @@ PanoramiXFreeGC(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); - result = dixLookupResourceByType((pointer *) &gc, stuff->id, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->id, XRT_GC, client, DixDestroyAccess); if (result != Success) return result; @@ -1013,7 +1013,7 @@ PanoramiXClearToBackground(ClientPtr client) REQUEST_SIZE_MATCH(xClearAreaReq); - result = dixLookupResourceByType((pointer *) &win, stuff->window, + result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; @@ -1058,14 +1058,14 @@ PanoramiXCopyArea(ClientPtr client) REQUEST_SIZE_MATCH(xCopyAreaReq); - result = dixLookupResourceByClass((pointer *) &src, stuff->srcDrawable, + result = dixLookupResourceByClass((void **) &src, stuff->srcDrawable, XRC_DRAWABLE, client, DixReadAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; srcShared = IS_SHARED_PIXMAP(src); - result = dixLookupResourceByClass((pointer *) &dst, stuff->dstDrawable, + result = dixLookupResourceByClass((void **) &dst, stuff->dstDrawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1075,7 +1075,7 @@ PanoramiXCopyArea(ClientPtr client) if (dstShared && srcShared) return (*SavedProcVector[X_CopyArea]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1217,14 +1217,14 @@ PanoramiXCopyPlane(ClientPtr client) REQUEST_SIZE_MATCH(xCopyPlaneReq); - rc = dixLookupResourceByClass((pointer *) &src, stuff->srcDrawable, + rc = dixLookupResourceByClass((void **) &src, stuff->srcDrawable, XRC_DRAWABLE, client, DixReadAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; srcShared = IS_SHARED_PIXMAP(src); - rc = dixLookupResourceByClass((pointer *) &dst, stuff->dstDrawable, + rc = dixLookupResourceByClass((void **) &dst, stuff->dstDrawable, XRC_DRAWABLE, client, DixWriteAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; @@ -1234,7 +1234,7 @@ PanoramiXCopyPlane(ClientPtr client) if (dstShared && srcShared) return (*SavedProcVector[X_CopyPlane]) (client); - rc = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + rc = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (rc != Success) return rc; @@ -1325,7 +1325,7 @@ PanoramiXPolyPoint(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyPointReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1333,7 +1333,7 @@ PanoramiXPolyPoint(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyPoint]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1390,7 +1390,7 @@ PanoramiXPolyLine(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyLineReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1398,7 +1398,7 @@ PanoramiXPolyLine(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyLine]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1455,7 +1455,7 @@ PanoramiXPolySegment(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolySegmentReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1463,7 +1463,7 @@ PanoramiXPolySegment(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolySegment]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1523,7 +1523,7 @@ PanoramiXPolyRectangle(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyRectangleReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1531,7 +1531,7 @@ PanoramiXPolyRectangle(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyRectangle]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1590,7 +1590,7 @@ PanoramiXPolyArc(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyArcReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1598,7 +1598,7 @@ PanoramiXPolyArc(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyArc]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1655,7 +1655,7 @@ PanoramiXFillPoly(ClientPtr client) REQUEST_AT_LEAST_SIZE(xFillPolyReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1663,7 +1663,7 @@ PanoramiXFillPoly(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_FillPoly]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1721,7 +1721,7 @@ PanoramiXPolyFillRectangle(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1729,7 +1729,7 @@ PanoramiXPolyFillRectangle(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyFillRectangle]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1788,7 +1788,7 @@ PanoramiXPolyFillArc(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1796,7 +1796,7 @@ PanoramiXPolyFillArc(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyFillArc]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1853,7 +1853,7 @@ PanoramiXPutImage(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPutImageReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -1861,7 +1861,7 @@ PanoramiXPutImage(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PutImage]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -1907,7 +1907,7 @@ PanoramiXGetImage(ClientPtr client) return BadValue; } - rc = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; @@ -2053,7 +2053,7 @@ PanoramiXPolyText8(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyTextReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -2061,7 +2061,7 @@ PanoramiXPolyText8(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyText8]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -2096,7 +2096,7 @@ PanoramiXPolyText16(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyTextReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -2104,7 +2104,7 @@ PanoramiXPolyText16(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyText16]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -2139,7 +2139,7 @@ PanoramiXImageText8(ClientPtr client) REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -2147,7 +2147,7 @@ PanoramiXImageText8(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_ImageText8]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -2182,7 +2182,7 @@ PanoramiXImageText16(ClientPtr client) REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; @@ -2190,7 +2190,7 @@ PanoramiXImageText16(ClientPtr client) if (IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_ImageText16]) (client); - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -2223,7 +2223,7 @@ PanoramiXCreateColormap(ClientPtr client) REQUEST_SIZE_MATCH(xCreateColormapReq); - result = dixLookupResourceByType((pointer *) &win, stuff->window, + result = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; @@ -2264,7 +2264,7 @@ PanoramiXFreeColormap(ClientPtr client) client->errorValue = stuff->id; - result = dixLookupResourceByType((pointer *) &cmap, stuff->id, XRT_COLORMAP, + result = dixLookupResourceByType((void **) &cmap, stuff->id, XRT_COLORMAP, client, DixDestroyAccess); if (result != Success) return result; @@ -2294,7 +2294,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client) client->errorValue = stuff->srcCmap; - result = dixLookupResourceByType((pointer *) &cmap, stuff->srcCmap, + result = dixLookupResourceByType((void **) &cmap, stuff->srcCmap, XRT_COLORMAP, client, DixReadAccess | DixWriteAccess); if (result != Success) @@ -2333,7 +2333,7 @@ PanoramiXInstallColormap(ClientPtr client) client->errorValue = stuff->id; - result = dixLookupResourceByType((pointer *) &cmap, stuff->id, XRT_COLORMAP, + result = dixLookupResourceByType((void **) &cmap, stuff->id, XRT_COLORMAP, client, DixReadAccess); if (result != Success) return result; @@ -2358,7 +2358,7 @@ PanoramiXUninstallColormap(ClientPtr client) client->errorValue = stuff->id; - result = dixLookupResourceByType((pointer *) &cmap, stuff->id, XRT_COLORMAP, + result = dixLookupResourceByType((void **) &cmap, stuff->id, XRT_COLORMAP, client, DixReadAccess); if (result != Success) return result; @@ -2384,7 +2384,7 @@ PanoramiXAllocColor(ClientPtr client) client->errorValue = stuff->cmap; - result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, + result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; @@ -2410,7 +2410,7 @@ PanoramiXAllocNamedColor(ClientPtr client) client->errorValue = stuff->cmap; - result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, + result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; @@ -2436,7 +2436,7 @@ PanoramiXAllocColorCells(ClientPtr client) client->errorValue = stuff->cmap; - result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, + result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; @@ -2462,7 +2462,7 @@ PanoramiXAllocColorPlanes(ClientPtr client) client->errorValue = stuff->cmap; - result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, + result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; @@ -2488,7 +2488,7 @@ PanoramiXFreeColors(ClientPtr client) client->errorValue = stuff->cmap; - result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, + result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; @@ -2512,7 +2512,7 @@ PanoramiXStoreColors(ClientPtr client) client->errorValue = stuff->cmap; - result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, + result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; @@ -2538,7 +2538,7 @@ PanoramiXStoreNamedColor(ClientPtr client) client->errorValue = stuff->cmap; - result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, + result = dixLookupResourceByType((void **) &cmap, stuff->cmap, XRT_COLORMAP, client, DixWriteAccess); if (result != Success) return result; diff --git a/xorg-server/Xext/panoramiXsrv.h b/xorg-server/Xext/panoramiXsrv.h index 0fcde4fd5..6d93eec2e 100644 --- a/xorg-server/Xext/panoramiXsrv.h +++ b/xorg-server/Xext/panoramiXsrv.h @@ -19,7 +19,7 @@ extern _X_EXPORT Bool PanoramiXCreateConnectionBlock(void); extern _X_EXPORT PanoramiXRes *PanoramiXFindIDByScrnum(RESTYPE, XID, int); extern _X_EXPORT Bool XineramaRegisterConnectionBlockCallback(void (*func) (void)); -extern _X_EXPORT int XineramaDeleteResource(pointer, XID); +extern _X_EXPORT int XineramaDeleteResource(void *, XID); extern _X_EXPORT void XineramaReinitData(void); diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c index e9633f4b3..6afd79c34 100644 --- a/xorg-server/Xext/saver.c +++ b/xorg-server/Xext/saver.c @@ -113,9 +113,7 @@ typedef struct _ScreenSaverSuspension { int count; } ScreenSaverSuspensionRec; -static int ScreenSaverFreeSuspend(pointer /*value */ , - XID /* id */ - ); +static int ScreenSaverFreeSuspend(void *value, XID id); /* * each screen has a list of clients requesting @@ -137,18 +135,14 @@ typedef struct _ScreenSaverEvent { CARD32 mask; } ScreenSaverEventRec; -static int ScreenSaverFreeEvents(pointer /* value */ , - XID /* id */ - ); +static int ScreenSaverFreeEvents(void * value, XID id); -static Bool setEventMask(ScreenPtr /* pScreen */ , - ClientPtr /* client */ , - unsigned long /* mask */ - ); +static Bool setEventMask(ScreenPtr pScreen, + ClientPtr client, + unsigned long mask); -static unsigned long getEventMask(ScreenPtr /* pScreen */ , - ClientPtr /* client */ - ); +static unsigned long getEventMask(ScreenPtr pScreen, + ClientPtr client); /* * when a client sets the screen saver attributes, a resource is @@ -174,21 +168,16 @@ typedef struct _ScreenSaverAttr { unsigned long *values; } ScreenSaverAttrRec, *ScreenSaverAttrPtr; -static int ScreenSaverFreeAttr(pointer /* value */ , - XID /* id */ - ); +static int ScreenSaverFreeAttr(void *value, XID id); -static void FreeAttrs(ScreenSaverAttrPtr /* pAttr */ - ); +static void FreeAttrs(ScreenSaverAttrPtr pAttr); -static void FreeScreenAttr(ScreenSaverAttrPtr /* pAttr */ - ); +static void FreeScreenAttr(ScreenSaverAttrPtr pAttr); static void - SendScreenSaverNotify(ScreenPtr /* pScreen */ , - int /* state */ , - Bool /* forced */ - ); +SendScreenSaverNotify(ScreenPtr pScreen, + int state, + Bool forced); typedef struct _ScreenSaverScreenPrivate { ScreenSaverEventPtr events; @@ -197,8 +186,7 @@ typedef struct _ScreenSaverScreenPrivate { Colormap installedMap; } ScreenSaverScreenPrivateRec, *ScreenSaverScreenPrivatePtr; -static ScreenSaverScreenPrivatePtr MakeScreenPrivate(ScreenPtr /* pScreen */ - ); +static ScreenSaverScreenPrivatePtr MakeScreenPrivate(ScreenPtr pScreen); static DevPrivateKeyRec ScreenPrivateKeyRec; @@ -294,7 +282,7 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask) pEv->client = client; pEv->screen = pScreen; pEv->resource = FakeClientID(client->index); - if (!AddResource(pEv->resource, SaverEventType, (pointer) pEv)) + if (!AddResource(pEv->resource, SaverEventType, (void *) pEv)) return FALSE; } pEv->mask = mask; @@ -325,7 +313,7 @@ FreeScreenAttr(ScreenSaverAttrPtr pAttr) } static int -ScreenSaverFreeEvents(pointer value, XID id) +ScreenSaverFreeEvents(void *value, XID id) { ScreenSaverEventPtr pOld = (ScreenSaverEventPtr) value; ScreenPtr pScreen = pOld->screen; @@ -347,7 +335,7 @@ ScreenSaverFreeEvents(pointer value, XID id) } static int -ScreenSaverFreeAttr(pointer value, XID id) +ScreenSaverFreeAttr(void *value, XID id) { ScreenSaverAttrPtr pOldAttr = (ScreenSaverAttrPtr) value; ScreenPtr pScreen = pOldAttr->screen; @@ -369,7 +357,7 @@ ScreenSaverFreeAttr(pointer value, XID id) } static int -ScreenSaverFreeSuspend(pointer value, XID id) +ScreenSaverFreeSuspend(void *value, XID id) { ScreenSaverSuspensionPtr data = (ScreenSaverSuspensionPtr) value; ScreenSaverSuspensionPtr *prev, this; @@ -465,7 +453,7 @@ UninstallSaverColormap(ScreenPtr pScreen) int rc; if (pPriv && pPriv->installedMap != None) { - rc = dixLookupResourceByType((pointer *) &pCmap, pPriv->installedMap, + rc = dixLookupResourceByType((void **) &pCmap, pPriv->installedMap, RT_COLORMAP, serverClient, DixUninstallAccess); if (rc == Success) @@ -576,7 +564,7 @@ CreateSaverWindow(ScreenPtr pScreen) if (i < numInstalled) return TRUE; - result = dixLookupResourceByType((pointer *) &pCmap, wantMap, RT_COLORMAP, + result = dixLookupResourceByType((void **) &pCmap, wantMap, RT_COLORMAP, serverClient, DixInstallAccess); if (result != Success) return TRUE; @@ -926,7 +914,7 @@ ScreenSaverSetAttributes(ClientPtr client) } else { ret = - dixLookupResourceByType((pointer *) &pPixmap, pixID, + dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (ret == Success) { if ((pPixmap->drawable.depth != depth) || @@ -958,7 +946,7 @@ ScreenSaverSetAttributes(ClientPtr client) } else { ret = - dixLookupResourceByType((pointer *) &pPixmap, pixID, + dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (ret == Success) { if ((pPixmap->drawable.depth != depth) || @@ -1042,7 +1030,7 @@ ScreenSaverSetAttributes(ClientPtr client) break; case CWColormap: cmap = (Colormap) * pVlist; - ret = dixLookupResourceByType((pointer *) &pCmap, cmap, RT_COLORMAP, + ret = dixLookupResourceByType((void **) &pCmap, cmap, RT_COLORMAP, client, DixUseAccess); if (ret != Success) { client->errorValue = cmap; @@ -1061,7 +1049,7 @@ ScreenSaverSetAttributes(ClientPtr client) *values++ = None; } else { - ret = dixLookupResourceByType((pointer *) &pCursor, cursorID, + ret = dixLookupResourceByType((void **) &pCursor, cursorID, RT_CURSOR, client, DixUseAccess); if (ret != Success) { client->errorValue = cursorID; @@ -1082,7 +1070,7 @@ ScreenSaverSetAttributes(ClientPtr client) FreeScreenAttr(pPriv->attr); pPriv->attr = pAttr; pAttr->resource = FakeClientID(client->index); - if (!AddResource(pAttr->resource, AttrType, (pointer) pAttr)) + if (!AddResource(pAttr->resource, AttrType, (void *) pAttr)) return BadAlloc; return Success; PatchUp: @@ -1134,7 +1122,7 @@ ProcScreenSaverSetAttributes(ClientPtr client) REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); - status = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + status = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (status != Success) return (status == BadValue) ? BadDrawable : status; @@ -1149,7 +1137,7 @@ ProcScreenSaverSetAttributes(ClientPtr client) pback_offset = Ones((Mask) stuff->mask & (CWBackPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { - status = dixLookupResourceByType((pointer *) &backPix, tmp, + status = dixLookupResourceByType((void **) &backPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (status != Success) @@ -1161,7 +1149,7 @@ ProcScreenSaverSetAttributes(ClientPtr client) pbord_offset = Ones((Mask) stuff->mask & (CWBorderPixmap - 1)); tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { - status = dixLookupResourceByType((pointer *) &bordPix, tmp, + status = dixLookupResourceByType((void **) &bordPix, tmp, XRT_PIXMAP, client, DixReadAccess); if (status != Success) @@ -1173,7 +1161,7 @@ ProcScreenSaverSetAttributes(ClientPtr client) cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1)); tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { - status = dixLookupResourceByType((pointer *) &cmap, tmp, + status = dixLookupResourceByType((void **) &cmap, tmp, XRT_COLORMAP, client, DixReadAccess); if (status != Success) @@ -1214,7 +1202,7 @@ ProcScreenSaverUnsetAttributes(ClientPtr client) PanoramiXRes *draw; int rc, i; - rc = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; @@ -1273,7 +1261,7 @@ ProcScreenSaverSuspend(ClientPtr client) this->count = 1; this->clientResource = FakeClientID(client->index); - if (!AddResource(this->clientResource, SuspendType, (pointer) this)) { + if (!AddResource(this->clientResource, SuspendType, (void *) this)) { free(this); return BadAlloc; } diff --git a/xorg-server/Xext/security.c b/xorg-server/Xext/security.c index dce3c9fba..b7c53a461 100644 --- a/xorg-server/Xext/security.c +++ b/xorg-server/Xext/security.c @@ -169,7 +169,7 @@ SecurityLookupRequestName(ClientPtr client) */ static int -SecurityDeleteAuthorization(pointer value, XID id) +SecurityDeleteAuthorization(void *value, XID id) { SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) value; unsigned short name_len, data_len; @@ -223,7 +223,7 @@ SecurityDeleteAuthorization(pointer value, XID id) /* resource delete function for RTEventClient */ static int -SecurityDeleteAuthorizationEventClient(pointer value, XID id) +SecurityDeleteAuthorizationEventClient(void *value, XID id) { OtherClientsPtr pEventClient, prev = NULL; SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) value; @@ -296,7 +296,7 @@ SecurityComputeAuthorizationTimeout(SecurityAuthorizationPtr pAuth, */ static CARD32 -SecurityAuthorizationExpired(OsTimerPtr timer, CARD32 time, pointer pval) +SecurityAuthorizationExpired(OsTimerPtr timer, CARD32 time, void *pval) { SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) pval; @@ -382,7 +382,7 @@ SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth, pEventClient->mask = mask; pEventClient->resource = FakeClientID(client->index); pEventClient->next = pAuth->eventClients; - if (!AddResource(pEventClient->resource, RTEventClient, (pointer) pAuth)) { + if (!AddResource(pEventClient->resource, RTEventClient, (void *) pAuth)) { free(pEventClient); return BadAlloc; } @@ -454,7 +454,7 @@ ProcSecurityGenerateAuthorization(ClientPtr client) vgi.group = group; vgi.valid = FALSE; - CallCallbacks(&SecurityValidateGroupCallback, (pointer) &vgi); + CallCallbacks(&SecurityValidateGroupCallback, (void *) &vgi); /* if nobody said they recognized it, it's an error */ @@ -574,7 +574,7 @@ ProcSecurityRevokeAuthorization(ClientPtr client) REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); - rc = dixLookupResourceByType((pointer *) &pAuth, stuff->authId, + rc = dixLookupResourceByType((void **) &pAuth, stuff->authId, SecurityAuthorizationResType, client, DixDestroyAccess); if (rc != Success) @@ -692,7 +692,7 @@ SwapSecurityAuthorizationRevokedEvent(xSecurityAuthorizationRevokedEvent * from, */ static void -SecurityDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecurityDevice(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceDeviceAccessRec *rec = calldata; SecurityStateRec *subj, *obj; @@ -736,7 +736,7 @@ SecurityDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata) */ static void -SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecurityResource(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceResourceAccessRec *rec = calldata; SecurityStateRec *subj, *obj; @@ -784,7 +784,7 @@ SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecurityExtension(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceExtAccessRec *rec = calldata; SecurityStateRec *subj; @@ -807,7 +807,7 @@ SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SecurityServer(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecurityServer(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceServerAccessRec *rec = calldata; SecurityStateRec *subj, *obj; @@ -826,7 +826,7 @@ SecurityServer(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SecurityClient(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecurityClient(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceClientAccessRec *rec = calldata; SecurityStateRec *subj, *obj; @@ -845,7 +845,7 @@ SecurityClient(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SecurityProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecurityProperty(CallbackListPtr *pcbl, void *unused, void *calldata) { XacePropertyAccessRec *rec = calldata; SecurityStateRec *subj, *obj; @@ -867,7 +867,7 @@ SecurityProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SecuritySend(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecuritySend(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceSendAccessRec *rec = calldata; SecurityStateRec *subj, *obj; @@ -899,7 +899,7 @@ SecuritySend(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SecurityReceive(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecurityReceive(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceReceiveAccessRec *rec = calldata; SecurityStateRec *subj, *obj; @@ -940,7 +940,7 @@ SecurityReceive(CallbackListPtr *pcbl, pointer unused, pointer calldata) */ static void -SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SecurityClientState(CallbackListPtr *pcbl, void *unused, void *calldata) { NewClientInfoRec *pci = calldata; SecurityStateRec *state; @@ -959,7 +959,7 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) case ClientStateRunning: state->authId = AuthorizationIDOfClient(pci->client); - rc = dixLookupResourceByType((pointer *) &pAuth, state->authId, + rc = dixLookupResourceByType((void **) &pAuth, state->authId, SecurityAuthorizationResType, serverClient, DixGetAttrAccess); if (rc == Success) { @@ -975,7 +975,7 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) case ClientStateGone: case ClientStateRetained: - rc = dixLookupResourceByType((pointer *) &pAuth, state->authId, + rc = dixLookupResourceByType((void **) &pAuth, state->authId, SecurityAuthorizationResType, serverClient, DixGetAttrAccess); if (rc == Success && state->live) { diff --git a/xorg-server/Xext/shape.c b/xorg-server/Xext/shape.c index dfe6fe70b..c6ff360ac 100644 --- a/xorg-server/Xext/shape.c +++ b/xorg-server/Xext/shape.c @@ -52,11 +52,11 @@ in this Software without prior written authorization from The Open Group. typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */ ); -static int ShapeFreeClient(pointer /* data */ , - XID /* id */ +static int ShapeFreeClient(void * /* data */ , + XID /* id */ ); -static int ShapeFreeEvents(pointer /* data */ , - XID /* id */ +static int ShapeFreeEvents(void * /* data */ , + XID /* id */ ); static void SShapeNotifyEvent(xShapeNotifyEvent * /* from */ , xShapeNotifyEvent * /* to */ @@ -307,7 +307,7 @@ ProcPanoramiXShapeRectangles(ClientPtr client) REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq); - result = dixLookupResourceByType((pointer *) &win, stuff->dest, XRT_WINDOW, + result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; @@ -362,7 +362,7 @@ ProcShapeMask(ClientPtr client) if (stuff->src == None) srcRgn = 0; else { - rc = dixLookupResourceByType((pointer *) &pPixmap, stuff->src, + rc = dixLookupResourceByType((void **) &pPixmap, stuff->src, RT_PIXMAP, client, DixReadAccess); if (rc != Success) return rc; @@ -405,13 +405,13 @@ ProcPanoramiXShapeMask(ClientPtr client) REQUEST_SIZE_MATCH(xShapeMaskReq); - result = dixLookupResourceByType((pointer *) &win, stuff->dest, XRT_WINDOW, + result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; if (stuff->src != None) { - result = dixLookupResourceByType((pointer *) &pmap, stuff->src, + result = dixLookupResourceByType((void **) &pmap, stuff->src, XRT_PIXMAP, client, DixReadAccess); if (result != Success) return result; @@ -533,12 +533,12 @@ ProcPanoramiXShapeCombine(ClientPtr client) REQUEST_AT_LEAST_SIZE(xShapeCombineReq); - result = dixLookupResourceByType((pointer *) &win, stuff->dest, XRT_WINDOW, + result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; - result = dixLookupResourceByType((pointer *) &win2, stuff->src, XRT_WINDOW, + result = dixLookupResourceByType((void **) &win2, stuff->src, XRT_WINDOW, client, DixReadAccess); if (result != Success) return result; @@ -604,7 +604,7 @@ ProcPanoramiXShapeOffset(ClientPtr client) REQUEST_AT_LEAST_SIZE(xShapeOffsetReq); - result = dixLookupResourceByType((pointer *) &win, stuff->dest, XRT_WINDOW, + result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW, client, DixWriteAccess); if (result != Success) return result; @@ -686,7 +686,7 @@ ProcShapeQueryExtents(ClientPtr client) } /*ARGSUSED*/ static int -ShapeFreeClient(pointer data, XID id) +ShapeFreeClient(void *data, XID id) { ShapeEventPtr pShapeEvent; WindowPtr pWin; @@ -695,7 +695,7 @@ ShapeFreeClient(pointer data, XID id) pShapeEvent = (ShapeEventPtr) data; pWin = pShapeEvent->window; - rc = dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, ShapeEventType, serverClient, DixReadAccess); if (rc == Success) { pPrev = 0; @@ -708,12 +708,12 @@ ShapeFreeClient(pointer data, XID id) *pHead = pShapeEvent->next; } } - free((pointer) pShapeEvent); + free((void *) pShapeEvent); return 1; } /*ARGSUSED*/ static int -ShapeFreeEvents(pointer data, XID id) +ShapeFreeEvents(void *data, XID id) { ShapeEventPtr *pHead, pCur, pNext; @@ -721,9 +721,9 @@ ShapeFreeEvents(pointer data, XID id) for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource(pCur->clientResource, ClientType); - free((pointer) pCur); + free((void *) pCur); } - free((pointer) pHead); + free((void *) pHead); return 1; } @@ -740,7 +740,7 @@ ProcShapeSelectInput(ClientPtr client) rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess); if (rc != Success) return rc; - rc = dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, ShapeEventType, client, DixWriteAccess); if (rc != Success && rc != BadValue) return rc; @@ -770,10 +770,10 @@ ProcShapeSelectInput(ClientPtr client) */ clientResource = FakeClientID(client->index); pNewShapeEvent->clientResource = clientResource; - if (!AddResource(clientResource, ClientType, (pointer) pNewShapeEvent)) + if (!AddResource(clientResource, ClientType, (void *) pNewShapeEvent)) return BadAlloc; /* - * create a resource to contain a pointer to the list + * create a resource to contain a void *to the list * of clients selecting input. This must be indirect as * the list may be arbitrarily rearranged which cannot be * done through the resource database. @@ -782,7 +782,7 @@ ProcShapeSelectInput(ClientPtr client) pHead = malloc(sizeof(ShapeEventPtr)); if (!pHead || !AddResource(pWin->drawable.id, ShapeEventType, - (pointer) pHead)) { + (void *) pHead)) { FreeResource(clientResource, RT_NONE); return BadAlloc; } @@ -831,7 +831,7 @@ SendShapeNotify(WindowPtr pWin, int which) BYTE shaped; int rc; - rc = dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, ShapeEventType, serverClient, DixReadAccess); if (rc != Success) return; @@ -909,7 +909,7 @@ ProcShapeInputSelected(ClientPtr client) rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; - rc = dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, ShapeEventType, client, DixReadAccess); if (rc != Success && rc != BadValue) return rc; diff --git a/xorg-server/Xext/shm.c b/xorg-server/Xext/shm.c index 2cf720ed7..31c19e346 100644 --- a/xorg-server/Xext/shm.c +++ b/xorg-server/Xext/shm.c @@ -101,14 +101,10 @@ typedef struct _ShmScrPrivateRec { } ShmScrPrivateRec; static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS); -static int ShmDetachSegment(pointer /* value */ , - XID /* shmseg */ - ); -static void ShmResetProc(ExtensionEntry * /* extEntry */ - ); -static void SShmCompletionEvent(xShmCompletionEvent * /* from */ , - xShmCompletionEvent * /* to */ - ); +static int ShmDetachSegment(void *value, XID shmseg); +static void ShmResetProc(ExtensionEntry *extEntry); +static void SShmCompletionEvent(xShmCompletionEvent *from, + xShmCompletionEvent *to); static Bool ShmDestroyPixmap(PixmapPtr pPixmap); @@ -132,7 +128,7 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL }; #define VERIFY_SHMSEG(shmseg,shmdesc,client) \ { \ int tmprc; \ - tmprc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \ + tmprc = dixLookupResourceByType((void **)&(shmdesc), shmseg, ShmSegType, \ client, DixReadAccess); \ if (tmprc != Success) \ return tmprc; \ @@ -262,7 +258,7 @@ ShmDestroyPixmap(PixmapPtr pPixmap) shmdesc = (ShmDescPtr) dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey); if (shmdesc) - ShmDetachSegment((pointer) shmdesc, pPixmap->drawable.id); + ShmDetachSegment((void *) shmdesc, pPixmap->drawable.id); } pScreen->DestroyPixmap = screen_priv->destroyPixmap; @@ -442,13 +438,13 @@ ProcShmAttach(ClientPtr client) shmdesc->next = Shmsegs; Shmsegs = shmdesc; } - if (!AddResource(stuff->shmseg, ShmSegType, (pointer) shmdesc)) + if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) return BadAlloc; return Success; } /*ARGSUSED*/ static int -ShmDetachSegment(pointer value, /* must conform to DeleteType */ +ShmDetachSegment(void *value, /* must conform to DeleteType */ XID shmseg) { ShmDescPtr shmdesc = (ShmDescPtr) value; @@ -748,12 +744,12 @@ ProcPanoramiXShmPutImage(ClientPtr client) REQUEST(xShmPutImageReq); REQUEST_SIZE_MATCH(xShmPutImageReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; @@ -802,7 +798,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) return BadValue; } - rc = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (rc != Success) return (rc == BadValue) ? BadDrawable : rc; @@ -999,7 +995,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client) shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = newPix->info[j].id; - if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer) pMap)) { + if (!AddResource(newPix->info[j].id, RT_PIXMAP, (void *) pMap)) { result = BadAlloc; break; } @@ -1035,7 +1031,7 @@ fbShmCreatePixmap(ScreenPtr pScreen, if (!(*pScreen->ModifyPixmapHeader) (pPixmap, width, height, depth, BitsPerPixel(depth), PixmapBytePad(width, depth), - (pointer) addr)) { + (void *) addr)) { (*pScreen->DestroyPixmap) (pPixmap); return NullPixmap; } @@ -1114,7 +1110,7 @@ ProcShmCreatePixmap(ClientPtr client) shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; - if (AddResource(stuff->pid, RT_PIXMAP, (pointer) pMap)) { + if (AddResource(stuff->pid, RT_PIXMAP, (void *) pMap)) { return Success; } } @@ -1191,7 +1187,7 @@ ProcShmAttachFd(ClientPtr client) shmdesc->next = Shmsegs; Shmsegs = shmdesc; - if (!AddResource(stuff->shmseg, ShmSegType, (pointer) shmdesc)) + if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) return BadAlloc; return Success; } @@ -1282,7 +1278,7 @@ ProcShmCreateSegment(ClientPtr client) shmdesc->next = Shmsegs; Shmsegs = shmdesc; - if (!AddResource(stuff->shmseg, ShmSegType, (pointer) shmdesc)) { + if (!AddResource(stuff->shmseg, ShmSegType, (void *) shmdesc)) { close(fd); return BadAlloc; } diff --git a/xorg-server/Xext/sleepuntil.c b/xorg-server/Xext/sleepuntil.c index 52e22b4a6..993c028b8 100644 --- a/xorg-server/Xext/sleepuntil.c +++ b/xorg-server/Xext/sleepuntil.c @@ -46,10 +46,10 @@ typedef struct _Sertafied { ClientPtr pClient; XID id; void (*notifyFunc) (ClientPtr /* client */ , - pointer /* closure */ + void * /* closure */ ); - pointer closure; + void *closure; } SertafiedRec, *SertafiedPtr; static SertafiedPtr pPending; @@ -58,24 +58,24 @@ static Bool BlockHandlerRegistered; static int SertafiedGeneration; static void ClientAwaken(ClientPtr /* client */ , - pointer /* closure */ + void * /* closure */ ); -static int SertafiedDelete(pointer /* value */ , - XID /* id */ +static int SertafiedDelete(void * /* value */ , + XID /* id */ ); -static void SertafiedBlockHandler(pointer /* data */ , +static void SertafiedBlockHandler(void * /* data */ , OSTimePtr /* wt */ , - pointer /* LastSelectMask */ + void * /* LastSelectMask */ ); -static void SertafiedWakeupHandler(pointer /* data */ , - int /* i */ , - pointer /* LastSelectMask */ +static void SertafiedWakeupHandler(void * /* data */ , + int /* i */ , + void * /* LastSelectMask */ ); int ClientSleepUntil(ClientPtr client, TimeStamp *revive, - void (*notifyFunc) (ClientPtr, pointer), pointer closure) + void (*notifyFunc) (ClientPtr, void *), void *closure) { SertafiedPtr pRequest, pReq, pPrev; @@ -97,14 +97,14 @@ ClientSleepUntil(ClientPtr client, if (!BlockHandlerRegistered) { if (!RegisterBlockAndWakeupHandlers(SertafiedBlockHandler, SertafiedWakeupHandler, - (pointer) 0)) { + (void *) 0)) { free(pRequest); return FALSE; } BlockHandlerRegistered = TRUE; } pRequest->notifyFunc = 0; - if (!AddResource(pRequest->id, SertafiedResType, (pointer) pRequest)) + if (!AddResource(pRequest->id, SertafiedResType, (void *) pRequest)) return FALSE; if (!notifyFunc) notifyFunc = ClientAwaken; @@ -126,14 +126,14 @@ ClientSleepUntil(ClientPtr client, } static void -ClientAwaken(ClientPtr client, pointer closure) +ClientAwaken(ClientPtr client, void *closure) { if (!client->clientGone) AttendClient(client); } static int -SertafiedDelete(pointer value, XID id) +SertafiedDelete(void *value, XID id) { SertafiedPtr pRequest = (SertafiedPtr) value; SertafiedPtr pReq, pPrev; @@ -154,7 +154,7 @@ SertafiedDelete(pointer value, XID id) } static void -SertafiedBlockHandler(pointer data, OSTimePtr wt, pointer LastSelectMask) +SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask) { SertafiedPtr pReq, pNext; unsigned long delay; @@ -186,7 +186,7 @@ SertafiedBlockHandler(pointer data, OSTimePtr wt, pointer LastSelectMask) } static void -SertafiedWakeupHandler(pointer data, int i, pointer LastSelectMask) +SertafiedWakeupHandler(void *data, int i, void *LastSelectMask) { SertafiedPtr pReq, pNext; TimeStamp now; @@ -203,7 +203,7 @@ SertafiedWakeupHandler(pointer data, int i, pointer LastSelectMask) } if (!pPending) { RemoveBlockAndWakeupHandlers(SertafiedBlockHandler, - SertafiedWakeupHandler, (pointer) 0); + SertafiedWakeupHandler, (void *) 0); BlockHandlerRegistered = FALSE; } } diff --git a/xorg-server/Xext/sleepuntil.h b/xorg-server/Xext/sleepuntil.h index 5c7084842..e9b8388f9 100644 --- a/xorg-server/Xext/sleepuntil.h +++ b/xorg-server/Xext/sleepuntil.h @@ -36,7 +36,7 @@ extern int ClientSleepUntil(ClientPtr client, TimeStamp *revive, void (*notifyFunc) (ClientPtr /* client */ , - pointer /* closure */ - ), pointer Closure); + void * /* closure */ + ), void *Closure); #endif diff --git a/xorg-server/Xext/sync.c b/xorg-server/Xext/sync.c index 1b31e7a4e..7129e9833 100644 --- a/xorg-server/Xext/sync.c +++ b/xorg-server/Xext/sync.c @@ -324,7 +324,7 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject, if (changes & XSyncCACounter) { if (syncObject == None) pSync = NULL; - else if (Success != (rc = dixLookupResourceByType((pointer *) &pSync, + else if (Success != (rc = dixLookupResourceByType((void **) &pSync, syncObject, resType, client, DixReadAccess))) { @@ -344,7 +344,7 @@ SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject, pCounter = (SyncCounter *) pSync; if (IsSystemCounter(pCounter)) { - (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, + (*pCounter->pSysCounterInfo->QueryValue) ((void *) pCounter, &pCounter->value); } } @@ -931,7 +931,7 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL return status; } - if (!AddResource(id, RTFence, (pointer) pFence)) + if (!AddResource(id, RTFence, (void *) pFence)) return BadAlloc; return Success; @@ -961,7 +961,7 @@ SyncCreateCounter(ClientPtr client, XSyncCounter id, CARD64 initialvalue) pCounter->value = initialvalue; pCounter->pSysCounterInfo = NULL; - if (!AddResource(id, RTCounter, (pointer) pCounter)) + if (!AddResource(id, RTCounter, (void *) pCounter)) return NULL; return pCounter; @@ -1021,7 +1021,7 @@ SyncCreateSystemCounter(const char *name, } void -SyncDestroySystemCounter(pointer pSysCounter) +SyncDestroySystemCounter(void *pSysCounter) { SyncCounter *pCounter = (SyncCounter *) pSysCounter; @@ -1119,7 +1119,7 @@ SyncComputeBracketValues(SyncCounter * pCounter) } } /* end for each trigger */ - (*psci->BracketValues) ((pointer) pCounter, pnewltval, pnewgtval); + (*psci->BracketValues) ((void *) pCounter, pnewltval, pnewgtval); } @@ -1433,7 +1433,7 @@ ProcSyncSetCounter(ClientPtr client) REQUEST_SIZE_MATCH(xSyncSetCounterReq); - rc = dixLookupResourceByType((pointer *) &pCounter, stuff->cid, RTCounter, + rc = dixLookupResourceByType((void **) &pCounter, stuff->cid, RTCounter, client, DixWriteAccess); if (rc != Success) return rc; @@ -1462,7 +1462,7 @@ ProcSyncChangeCounter(ClientPtr client) REQUEST_SIZE_MATCH(xSyncChangeCounterReq); - rc = dixLookupResourceByType((pointer *) &pCounter, stuff->cid, RTCounter, + rc = dixLookupResourceByType((void **) &pCounter, stuff->cid, RTCounter, client, DixWriteAccess); if (rc != Success) return rc; @@ -1495,7 +1495,7 @@ ProcSyncDestroyCounter(ClientPtr client) REQUEST_SIZE_MATCH(xSyncDestroyCounterReq); - rc = dixLookupResourceByType((pointer *) &pCounter, stuff->counter, + rc = dixLookupResourceByType((void **) &pCounter, stuff->counter, RTCounter, client, DixDestroyAccess); if (rc != Success) return rc; @@ -1656,14 +1656,14 @@ ProcSyncQueryCounter(ClientPtr client) REQUEST_SIZE_MATCH(xSyncQueryCounterReq); - rc = dixLookupResourceByType((pointer *) &pCounter, stuff->counter, + rc = dixLookupResourceByType((void **) &pCounter, stuff->counter, RTCounter, client, DixReadAccess); if (rc != Success) return rc; /* if system counter, ask it what the current value is */ if (IsSystemCounter(pCounter)) { - (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, + (*pCounter->pSysCounterInfo->QueryValue) ((void *) pCounter, &pCounter->value); } @@ -1781,7 +1781,7 @@ ProcSyncChangeAlarm(ClientPtr client) REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); - status = dixLookupResourceByType((pointer *) &pAlarm, stuff->alarm, RTAlarm, + status = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm, client, DixWriteAccess); if (status != Success) return status; @@ -1822,7 +1822,7 @@ ProcSyncQueryAlarm(ClientPtr client) REQUEST_SIZE_MATCH(xSyncQueryAlarmReq); - rc = dixLookupResourceByType((pointer *) &pAlarm, stuff->alarm, RTAlarm, + rc = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm, client, DixReadAccess); if (rc != Success) return rc; @@ -1879,7 +1879,7 @@ ProcSyncDestroyAlarm(ClientPtr client) REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); - rc = dixLookupResourceByType((pointer *) &pAlarm, stuff->alarm, RTAlarm, + rc = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm, client, DixDestroyAccess); if (rc != Success) return rc; @@ -1909,7 +1909,7 @@ ProcSyncCreateFence(ClientPtr client) miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered); - if (!AddResource(stuff->fid, RTFence, (pointer) pFence)) + if (!AddResource(stuff->fid, RTFence, (void *) pFence)) return BadAlloc; return client->noClientException; @@ -1928,7 +1928,7 @@ FreeFence(void *obj, XID id) int SyncVerifyFence(SyncFence ** ppSyncFence, XID fid, ClientPtr client, Mask mode) { - int rc = dixLookupResourceByType((pointer *) ppSyncFence, fid, RTFence, + int rc = dixLookupResourceByType((void **) ppSyncFence, fid, RTFence, client, mode); if (rc != Success) @@ -1946,7 +1946,7 @@ ProcSyncTriggerFence(ClientPtr client) REQUEST_SIZE_MATCH(xSyncTriggerFenceReq); - rc = dixLookupResourceByType((pointer *) &pFence, stuff->fid, RTFence, + rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence, client, DixWriteAccess); if (rc != Success) return rc; @@ -1965,7 +1965,7 @@ ProcSyncResetFence(ClientPtr client) REQUEST_SIZE_MATCH(xSyncResetFenceReq); - rc = dixLookupResourceByType((pointer *) &pFence, stuff->fid, RTFence, + rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence, client, DixWriteAccess); if (rc != Success) return rc; @@ -1987,7 +1987,7 @@ ProcSyncDestroyFence(ClientPtr client) REQUEST_SIZE_MATCH(xSyncDestroyFenceReq); - rc = dixLookupResourceByType((pointer *) &pFence, stuff->fid, RTFence, + rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence, client, DixDestroyAccess); if (rc != Success) return rc; @@ -2006,7 +2006,7 @@ ProcSyncQueryFence(ClientPtr client) REQUEST_SIZE_MATCH(xSyncQueryFenceReq); - rc = dixLookupResourceByType((pointer *) &pFence, stuff->fid, + rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence, client, DixReadAccess); if (rc != Success) return rc; @@ -2554,7 +2554,7 @@ SyncExtensionInit(void) * ***** SERVERTIME implementation - should go in its own file in OS directory? */ -static pointer ServertimeCounter; +static void *ServertimeCounter; static XSyncValue Now; static XSyncValue *pnext_time; @@ -2655,7 +2655,7 @@ typedef struct { } IdleCounterPriv; static void -IdleTimeQueryValue(pointer pCounter, CARD64 * pValue_return) +IdleTimeQueryValue(void *pCounter, CARD64 * pValue_return) { int deviceid; CARD32 idle; @@ -2672,7 +2672,7 @@ IdleTimeQueryValue(pointer pCounter, CARD64 * pValue_return) } static void -IdleTimeBlockHandler(pointer pCounter, struct timeval **wt, pointer LastSelectMask) +IdleTimeBlockHandler(void *pCounter, struct timeval **wt, void *LastSelectMask) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); @@ -2768,7 +2768,7 @@ IdleTimeCheckBrackets(SyncCounter *counter, XSyncValue idle, XSyncValue *less, X } static void -IdleTimeWakeupHandler(pointer pCounter, int rc, pointer LastSelectMask) +IdleTimeWakeupHandler(void *pCounter, int rc, void *LastSelectMask) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); @@ -2802,7 +2802,7 @@ IdleTimeWakeupHandler(pointer pCounter, int rc, pointer LastSelectMask) } static void -IdleTimeBracketValues(pointer pCounter, CARD64 * pbracket_less, +IdleTimeBracketValues(void *pCounter, CARD64 * pbracket_less, CARD64 * pbracket_greater) { SyncCounter *counter = pCounter; diff --git a/xorg-server/Xext/syncsrv.h b/xorg-server/Xext/syncsrv.h index 45fca04da..8c2c00df0 100644 --- a/xorg-server/Xext/syncsrv.h +++ b/xorg-server/Xext/syncsrv.h @@ -66,10 +66,10 @@ typedef enum { XSyncCounterUnrestricted } SyncCounterType; -typedef void (*SyncSystemCounterQueryValue)(pointer counter, +typedef void (*SyncSystemCounterQueryValue)(void *counter, CARD64 *value_return ); -typedef void (*SyncSystemCounterBracketValues)(pointer counter, +typedef void (*SyncSystemCounterBracketValues)(void *counter, CARD64 *pbracket_less, CARD64 *pbracket_greater ); @@ -132,7 +132,7 @@ extern void SyncChangeCounter(SyncCounter *pCounter, CARD64 new_value ); -extern void SyncDestroySystemCounter(pointer pCounter); +extern void SyncDestroySystemCounter(void *pCounter); extern SyncCounter *SyncInitDeviceIdleTime(DeviceIntPtr dev); extern void SyncRemoveDeviceIdleTime(SyncCounter *counter); diff --git a/xorg-server/Xext/xace.c b/xorg-server/Xext/xace.c index 2bfe5ecf4..b8d5b4090 100644 --- a/xorg-server/Xext/xace.c +++ b/xorg-server/Xext/xace.c @@ -124,9 +124,9 @@ XaceHook(int hook, ...) u.res.client = va_arg(ap, ClientPtr); u.res.id = va_arg(ap, XID); u.res.rtype = va_arg(ap, RESTYPE); - u.res.res = va_arg(ap, pointer); + u.res.res = va_arg(ap, void *); u.res.ptype = va_arg(ap, RESTYPE); - u.res.parent = va_arg(ap, pointer); + u.res.parent = va_arg(ap, void *); u.res.access_mode = va_arg(ap, Mask); u.res.status = Success; /* default allow */ @@ -290,7 +290,7 @@ XaceCensorImage(ClientPtr client, pPix = GetScratchPixmapHeader(pDraw->pScreen, w, h, depth, bitsPerPixel, - widthBytesLine, (pointer) pBuf); + widthBytesLine, (void *) pBuf); if (!pPix) { failed = TRUE; goto failSafe; diff --git a/xorg-server/Xext/xacestr.h b/xorg-server/Xext/xacestr.h index 989b0339f..6fe8eecc8 100644 --- a/xorg-server/Xext/xacestr.h +++ b/xorg-server/Xext/xacestr.h @@ -40,9 +40,9 @@ typedef struct { ClientPtr client; XID id; RESTYPE rtype; - pointer res; + void *res; RESTYPE ptype; - pointer parent; + void *parent; Mask access_mode; int status; } XaceResourceAccessRec; diff --git a/xorg-server/Xext/xres.c b/xorg-server/Xext/xres.c index cac2e12ab..32e8c8135 100644..100755 --- a/xorg-server/Xext/xres.c +++ b/xorg-server/Xext/xres.c @@ -193,7 +193,6 @@ DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx) static int ProcXResQueryVersion(ClientPtr client) { - REQUEST(xXResQueryVersionReq); xXResQueryVersionReply rep; REQUEST_SIZE_MATCH(xXResQueryVersionReq); @@ -266,7 +265,7 @@ ProcXResQueryClients(ClientPtr client) } static void -ResFindAllRes(pointer value, XID id, RESTYPE type, pointer cdata) +ResFindAllRes(void *value, XID id, RESTYPE type, void *cdata) { int *counts = (int *) cdata; @@ -363,7 +362,7 @@ ResGetApproxPixmapBytes(PixmapPtr pix) } static void -ResFindResourcePixmaps(pointer value, XID id, RESTYPE type, pointer cdata) +ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata) { SizeType sizeFunc = GetResourceTypeSizeFunc(type); ResourceSizeRec size = { 0, 0, 0 }; @@ -374,7 +373,7 @@ ResFindResourcePixmaps(pointer value, XID id, RESTYPE type, pointer cdata) } static void -ResFindPixmaps(pointer value, XID id, pointer cdata) +ResFindPixmaps(void *value, XID id, void *cdata) { unsigned long *bytes = (unsigned long *) cdata; PixmapPtr pix = (PixmapPtr) value; @@ -383,7 +382,7 @@ ResFindPixmaps(pointer value, XID id, pointer cdata) } static void -ResFindWindowPixmaps(pointer value, XID id, pointer cdata) +ResFindWindowPixmaps(void *value, XID id, void *cdata) { unsigned long *bytes = (unsigned long *) cdata; WindowPtr pWin = (WindowPtr) value; @@ -396,7 +395,7 @@ ResFindWindowPixmaps(pointer value, XID id, pointer cdata) } static void -ResFindGCPixmaps(pointer value, XID id, pointer cdata) +ResFindGCPixmaps(void *value, XID id, void *cdata) { unsigned long *bytes = (unsigned long *) cdata; GCPtr pGC = (GCPtr) value; @@ -409,7 +408,7 @@ ResFindGCPixmaps(pointer value, XID id, pointer cdata) } static void -ResFindPicturePixmaps(pointer value, XID id, pointer cdata) +ResFindPicturePixmaps(void *value, XID id, void *cdata) { #ifdef RENDER ResFindResourcePixmaps(value, id, PictureType, cdata); @@ -417,7 +416,7 @@ ResFindPicturePixmaps(pointer value, XID id, pointer cdata) } static void -ResFindCompositeClientWindowPixmaps (pointer value, XID id, pointer cdata) +ResFindCompositeClientWindowPixmaps (void *value, XID id, void *cdata) { #ifdef COMPOSITE ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata); @@ -444,32 +443,32 @@ ProcXResQueryClientPixmapBytes(ClientPtr client) bytes = 0; FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps, - (pointer) (&bytes)); + (void *) (&bytes)); /* * Make sure win background pixmaps also held to account. */ FindClientResourcesByType(clients[clientID], RT_WINDOW, - ResFindWindowPixmaps, (pointer) (&bytes)); + ResFindWindowPixmaps, (void *) (&bytes)); /* * GC Tile & Stipple pixmaps too. */ FindClientResourcesByType(clients[clientID], RT_GC, - ResFindGCPixmaps, (pointer) (&bytes)); + ResFindGCPixmaps, (void *) (&bytes)); #ifdef RENDER /* Render extension picture pixmaps. */ FindClientResourcesByType(clients[clientID], PictureType, ResFindPicturePixmaps, - (pointer)(&bytes)); + (void *)(&bytes)); #endif #ifdef COMPOSITE /* Composite extension client window pixmaps. */ FindClientResourcesByType(clients[clientID], CompositeClientWindowType, ResFindCompositeClientWindowPixmaps, - (pointer)(&bytes)); + (void *)(&bytes)); #endif @@ -749,10 +748,10 @@ SwapXResQueryResourceBytes(struct xorg_list *response) FindRes */ static void -AddSubResourceSizeSpec(pointer value, +AddSubResourceSizeSpec(void *value, XID id, RESTYPE type, - pointer cdata) + void *cdata) { ConstructResourceBytesCtx *ctx = cdata; @@ -814,7 +813,7 @@ AddSubResourceSizeSpec(pointer value, FindRes */ static void -AddResourceSizeValue(pointer ptr, XID id, RESTYPE type, pointer cdata) +AddResourceSizeValue(void *ptr, XID id, RESTYPE type, void *cdata) { ConstructResourceBytesCtx *ctx = cdata; if (ctx->status == Success && @@ -884,7 +883,7 @@ AddResourceSizeValue(pointer ptr, XID id, RESTYPE type, pointer cdata) @param[in/out] cdata The context object that contains the resource type */ static void -AddResourceSizeValueWithResType(pointer ptr, XID id, pointer cdata) +AddResourceSizeValueWithResType(void *ptr, XID id, void *cdata) { ConstructResourceBytesCtx *ctx = cdata; AddResourceSizeValue(ptr, id, ctx->resType, cdata); @@ -902,7 +901,7 @@ AddResourceSizeValueWithResType(pointer ptr, XID id, pointer cdata) type FindAllRes */ static void -AddResourceSizeValueByResource(pointer ptr, XID id, RESTYPE type, pointer cdata) +AddResourceSizeValueByResource(void *ptr, XID id, RESTYPE type, void *cdata) { ConstructResourceBytesCtx *ctx = cdata; xXResResourceIdSpec *spec = ctx->curSpec; @@ -1097,7 +1096,6 @@ ProcResDispatch(ClientPtr client) static int SProcXResQueryVersion(ClientPtr client) { - REQUEST(xXResQueryVersionReq); REQUEST_SIZE_MATCH(xXResQueryVersionReq); return ProcXResQueryVersion(client); } diff --git a/xorg-server/Xext/xselinux_ext.c b/xorg-server/Xext/xselinux_ext.c index 3115f03ea..fb7b2d526 100644 --- a/xorg-server/Xext/xselinux_ext.c +++ b/xorg-server/Xext/xselinux_ext.c @@ -245,7 +245,7 @@ ProcSELinuxGetDrawableContext(ClientPtr client) } static int -ProcSELinuxGetPropertyContext(ClientPtr client, pointer privKey) +ProcSELinuxGetPropertyContext(ClientPtr client, void *privKey) { WindowPtr pWin; PropertyPtr pProp; @@ -269,7 +269,7 @@ ProcSELinuxGetPropertyContext(ClientPtr client, pointer privKey) } static int -ProcSELinuxGetSelectionContext(ClientPtr client, pointer privKey) +ProcSELinuxGetSelectionContext(ClientPtr client, void *privKey) { Selection *pSel; SELinuxObjectRec *obj; @@ -576,7 +576,7 @@ SProcSELinuxGetDrawableContext(ClientPtr client) } static int -SProcSELinuxGetPropertyContext(ClientPtr client, pointer privKey) +SProcSELinuxGetPropertyContext(ClientPtr client, void *privKey) { REQUEST(SELinuxGetPropertyContextReq); @@ -587,7 +587,7 @@ SProcSELinuxGetPropertyContext(ClientPtr client, pointer privKey) } static int -SProcSELinuxGetSelectionContext(ClientPtr client, pointer privKey) +SProcSELinuxGetSelectionContext(ClientPtr client, void *privKey) { REQUEST(SELinuxGetContextReq); diff --git a/xorg-server/Xext/xselinux_hooks.c b/xorg-server/Xext/xselinux_hooks.c index e9c7e93d7..376d57518 100644 --- a/xorg-server/Xext/xselinux_hooks.c +++ b/xorg-server/Xext/xselinux_hooks.c @@ -74,10 +74,10 @@ static Atom atom_client_ctx; static security_id_t unlabeled_sid; /* forward declarations */ -static void SELinuxScreen(CallbackListPtr *, pointer, pointer); +static void SELinuxScreen(CallbackListPtr *, void *, void *); /* "true" pointer value for use as callback data */ -static pointer truep = (pointer) 1; +static void *truep = (void *) 1; /* * Performs an SELinux permission check. @@ -147,7 +147,7 @@ SELinuxLabelClient(ClientPtr client) strncpy(subj->command, cmdname, COMMAND_LEN - 1); if (!cached) - free((void *) cmdname); /* const char * */ + free(cmdname); /* const char * */ } finish: @@ -171,7 +171,7 @@ SELinuxLabelInitial(void) SELinuxSubjectRec *subj; SELinuxObjectRec *obj; security_context_t ctx; - pointer unused; + void *unused; /* Do the serverClient */ subj = dixLookupPrivate(&serverClient->devPrivates, subjectKey); @@ -326,7 +326,7 @@ SELinuxLog(int type, const char *fmt, ...) */ static void -SELinuxDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxDevice(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceDeviceAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -363,7 +363,7 @@ SELinuxDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxSend(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxSend(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceSendAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -405,7 +405,7 @@ SELinuxSend(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxReceive(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxReceive(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceReceiveAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -443,7 +443,7 @@ SELinuxReceive(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxExtension(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceExtAccessRec *rec = calldata; SELinuxSubjectRec *subj, *serv; @@ -484,7 +484,7 @@ SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxSelection(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceSelectionAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -544,7 +544,7 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxProperty(CallbackListPtr *pcbl, void *unused, void *calldata) { XacePropertyAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -608,7 +608,7 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxResource(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxResource(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceResourceAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -667,7 +667,7 @@ SELinuxResource(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxScreen(CallbackListPtr *pcbl, pointer is_saver, pointer calldata) +SELinuxScreen(CallbackListPtr *pcbl, void *is_saver, void *calldata) { XaceScreenAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -699,7 +699,7 @@ SELinuxScreen(CallbackListPtr *pcbl, pointer is_saver, pointer calldata) } static void -SELinuxClient(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxClient(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceClientAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -717,7 +717,7 @@ SELinuxClient(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxServer(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxServer(CallbackListPtr *pcbl, void *unused, void *calldata) { XaceServerAccessRec *rec = calldata; SELinuxSubjectRec *subj; @@ -739,7 +739,7 @@ SELinuxServer(CallbackListPtr *pcbl, pointer unused, pointer calldata) */ static void -SELinuxClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxClientState(CallbackListPtr *pcbl, void *unused, void *calldata) { NewClientInfoRec *pci = calldata; @@ -754,7 +754,7 @@ SELinuxClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) } static void -SELinuxResourceState(CallbackListPtr *pcbl, pointer unused, pointer calldata) +SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata) { ResourceStateInfoRec *rec = calldata; SELinuxSubjectRec *subj; diff --git a/xorg-server/Xext/xtest.c b/xorg-server/Xext/xtest.c index b0b974c78..9bd90be7f 100644 --- a/xorg-server/Xext/xtest.c +++ b/xorg-server/Xext/xtest.c @@ -125,7 +125,7 @@ ProcXTestCompareCursor(ClientPtr client) else if (stuff->cursor == XTestCurrentCursor) pCursor = GetSpriteCursor(ptr); else { - rc = dixLookupResourceByType((pointer *) &pCursor, stuff->cursor, + rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor, RT_CURSOR, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->cursor; diff --git a/xorg-server/Xext/xvdisp.c b/xorg-server/Xext/xvdisp.c index 613867a6b..f2d49a2b8 100644 --- a/xorg-server/Xext/xvdisp.c +++ b/xorg-server/Xext/xvdisp.c @@ -994,7 +994,7 @@ ProcXvShmPutImage(ClientPtr client) if (!pImage) return BadMatch; - status = dixLookupResourceByType((pointer *) &shmdesc, stuff->shmseg, + status = dixLookupResourceByType((void **) &shmdesc, stuff->shmseg, ShmSegType, serverClient, DixReadAccess); if (status != Success) return status; @@ -1512,12 +1512,12 @@ XineramaXvStopVideo(ClientPtr client) REQUEST(xvStopVideoReq); REQUEST_SIZE_MATCH(xvStopVideoReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; - result = dixLookupResourceByType((pointer *) &port, stuff->port, + result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; @@ -1542,7 +1542,7 @@ XineramaXvSetPortAttribute(ClientPtr client) REQUEST_SIZE_MATCH(xvSetPortAttributeReq); - result = dixLookupResourceByType((pointer *) &port, stuff->port, + result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; @@ -1568,17 +1568,17 @@ XineramaXvShmPutImage(ClientPtr client) REQUEST_SIZE_MATCH(xvShmPutImageReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; - result = dixLookupResourceByType((pointer *) &port, stuff->port, + result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; @@ -1620,17 +1620,17 @@ XineramaXvPutImage(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutImageReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; - result = dixLookupResourceByType((pointer *) &port, stuff->port, + result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; @@ -1668,17 +1668,17 @@ XineramaXvPutVideo(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutVideoReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; - result = dixLookupResourceByType((pointer *) &port, stuff->port, + result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; @@ -1716,17 +1716,17 @@ XineramaXvPutStill(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutImageReq); - result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable, + result = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; - result = dixLookupResourceByType((pointer *) &gc, stuff->gc, + result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC, client, DixReadAccess); if (result != Success) return result; - result = dixLookupResourceByType((pointer *) &port, stuff->port, + result = dixLookupResourceByType((void **) &port, stuff->port, XvXRTPort, client, DixReadAccess); if (result != Success) return result; diff --git a/xorg-server/Xext/xvdix.h b/xorg-server/Xext/xvdix.h index 9c6160c3b..bb08cf4c7 100644 --- a/xorg-server/Xext/xvdix.h +++ b/xorg-server/Xext/xvdix.h @@ -200,7 +200,7 @@ typedef struct _XvPortRec { #define VALIDATE_XV_PORT(portID, pPort, mode)\ {\ - int rc = dixLookupResourceByType((pointer *)&(pPort), portID,\ + int rc = dixLookupResourceByType((void **)&(pPort), portID,\ XvRTPort, client, mode);\ if (rc != Success)\ return rc;\ diff --git a/xorg-server/Xext/xvmain.c b/xorg-server/Xext/xvmain.c index 6515f7e56..9020b2497 100644 --- a/xorg-server/Xext/xvmain.c +++ b/xorg-server/Xext/xvmain.c @@ -134,12 +134,12 @@ static Bool XvCloseScreen(ScreenPtr); static Bool XvDestroyPixmap(PixmapPtr); static Bool XvDestroyWindow(WindowPtr); static void XvResetProc(ExtensionEntry *); -static int XvdiDestroyGrab(pointer, XID); -static int XvdiDestroyEncoding(pointer, XID); -static int XvdiDestroyVideoNotify(pointer, XID); -static int XvdiDestroyPortNotify(pointer, XID); -static int XvdiDestroyVideoNotifyList(pointer, XID); -static int XvdiDestroyPort(pointer, XID); +static int XvdiDestroyGrab(void *, XID); +static int XvdiDestroyEncoding(void *, XID); +static int XvdiDestroyVideoNotify(void *, XID); +static int XvdiDestroyPortNotify(void *, XID); +static int XvdiDestroyVideoNotifyList(void *, XID); +static int XvdiDestroyPort(void *, XID); static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int); /* @@ -450,20 +450,20 @@ XvdiVideoStopped(XvPortPtr pPort, int reason) } static int -XvdiDestroyPort(pointer pPort, XID id) +XvdiDestroyPort(void *pPort, XID id) { return (*((XvPortPtr) pPort)->pAdaptor->ddFreePort) (pPort); } static int -XvdiDestroyGrab(pointer pGrab, XID id) +XvdiDestroyGrab(void *pGrab, XID id) { ((XvGrabPtr) pGrab)->client = NULL; return Success; } static int -XvdiDestroyVideoNotify(pointer pn, XID id) +XvdiDestroyVideoNotify(void *pn, XID id) { /* JUST CLEAR OUT THE client POINTER FIELD */ @@ -472,7 +472,7 @@ XvdiDestroyVideoNotify(pointer pn, XID id) } static int -XvdiDestroyPortNotify(pointer pn, XID id) +XvdiDestroyPortNotify(void *pn, XID id) { /* JUST CLEAR OUT THE client POINTER FIELD */ @@ -481,7 +481,7 @@ XvdiDestroyPortNotify(pointer pn, XID id) } static int -XvdiDestroyVideoNotifyList(pointer pn, XID id) +XvdiDestroyVideoNotifyList(void *pn, XID id) { XvVideoNotifyPtr npn, cpn; @@ -500,7 +500,7 @@ XvdiDestroyVideoNotifyList(pointer pn, XID id) } static int -XvdiDestroyEncoding(pointer value, XID id) +XvdiDestroyEncoding(void *value, XID id) { return Success; } @@ -510,7 +510,7 @@ XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason) { XvVideoNotifyPtr pn; - dixLookupResourceByType((pointer *) &pn, pDraw->id, XvRTVideoNotifyList, + dixLookupResourceByType((void **) &pn, pDraw->id, XvRTVideoNotifyList, serverClient, DixReadAccess); while (pn) { @@ -843,7 +843,7 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff) /* FIND VideoNotify LIST */ - rc = dixLookupResourceByType((pointer *) &pn, pDraw->id, + rc = dixLookupResourceByType((void **) &pn, pDraw->id, XvRTVideoNotifyList, client, DixWriteAccess); if (rc != Success && rc != BadValue) return rc; diff --git a/xorg-server/Xext/xvmc.c b/xorg-server/Xext/xvmc.c index 5f0123b32..64eda922b 100644 --- a/xorg-server/Xext/xvmc.c +++ b/xorg-server/Xext/xvmc.c @@ -61,7 +61,7 @@ typedef struct { (XvMCScreenPtr)(dixLookupPrivate(&(pScreen)->devPrivates, XvMCScreenKey)) static int -XvMCDestroyContextRes(pointer data, XID id) +XvMCDestroyContextRes(void *data, XID id) { XvMCContextPtr pContext = (XvMCContextPtr) data; @@ -78,7 +78,7 @@ XvMCDestroyContextRes(pointer data, XID id) } static int -XvMCDestroySurfaceRes(pointer data, XID id) +XvMCDestroySurfaceRes(void *data, XID id) { XvMCSurfacePtr pSurface = (XvMCSurfacePtr) data; XvMCContextPtr pContext = pSurface->context; @@ -87,13 +87,13 @@ XvMCDestroySurfaceRes(pointer data, XID id) (*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface) (pSurface); free(pSurface); - XvMCDestroyContextRes((pointer) pContext, pContext->context_id); + XvMCDestroyContextRes((void *) pContext, pContext->context_id); return Success; } static int -XvMCDestroySubpictureRes(pointer data, XID id) +XvMCDestroySubpictureRes(void *data, XID id) { XvMCSubpicturePtr pSubpict = (XvMCSubpicturePtr) data; XvMCContextPtr pContext = pSubpict->context; @@ -102,7 +102,7 @@ XvMCDestroySubpictureRes(pointer data, XID id) (*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture) (pSubpict); free(pSubpict); - XvMCDestroyContextRes((pointer) pContext, pContext->context_id); + XvMCDestroyContextRes((void *) pContext, pContext->context_id); return Success; } @@ -276,7 +276,7 @@ ProcXvMCCreateContext(ClientPtr client) static int ProcXvMCDestroyContext(ClientPtr client) { - pointer val; + void *val; int rc; REQUEST(xvmcDestroyContextReq); @@ -306,7 +306,7 @@ ProcXvMCCreateSurface(ClientPtr client) REQUEST(xvmcCreateSurfaceReq); REQUEST_SIZE_MATCH(xvmcCreateSurfaceReq); - result = dixLookupResourceByType((pointer *) &pContext, stuff->context_id, + result = dixLookupResourceByType((void **) &pContext, stuff->context_id, XvMCRTContext, client, DixUseAccess); if (result != Success) return result; @@ -350,7 +350,7 @@ ProcXvMCCreateSurface(ClientPtr client) static int ProcXvMCDestroySurface(ClientPtr client) { - pointer val; + void *val; int rc; REQUEST(xvmcDestroySurfaceReq); @@ -382,7 +382,7 @@ ProcXvMCCreateSubpicture(ClientPtr client) REQUEST(xvmcCreateSubpictureReq); REQUEST_SIZE_MATCH(xvmcCreateSubpictureReq); - result = dixLookupResourceByType((pointer *) &pContext, stuff->context_id, + result = dixLookupResourceByType((void **) &pContext, stuff->context_id, XvMCRTContext, client, DixUseAccess); if (result != Success) return result; @@ -474,7 +474,7 @@ ProcXvMCCreateSubpicture(ClientPtr client) static int ProcXvMCDestroySubpicture(ClientPtr client) { - pointer val; + void *val; int rc; REQUEST(xvmcDestroySubpictureReq); @@ -800,8 +800,8 @@ XvMCFindXvImage(XvPortPtr pPort, CARD32 id) } int -xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name, - char *busID, int major, int minor, int patchLevel) +xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name, + const char *busID, int major, int minor, int patchLevel) { XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen); diff --git a/xorg-server/Xext/xvmcext.h b/xorg-server/Xext/xvmcext.h index 2201d7b5b..e8a6dae47 100644 --- a/xorg-server/Xext/xvmcext.h +++ b/xorg-server/Xext/xvmcext.h @@ -31,15 +31,15 @@ typedef struct { unsigned short height; CARD32 flags; int refcnt; - pointer port_priv; - pointer driver_priv; + void *port_priv; + void *driver_priv; } XvMCContextRec, *XvMCContextPtr; typedef struct { XID surface_id; int surface_type_id; XvMCContextPtr context; - pointer driver_priv; + void *driver_priv; } XvMCSurfaceRec, *XvMCSurfacePtr; typedef struct { @@ -51,7 +51,7 @@ typedef struct { int entry_bytes; char component_order[4]; XvMCContextPtr context; - pointer driver_priv; + void *driver_priv; } XvMCSubpictureRec, *XvMCSubpicturePtr; typedef int (*XvMCCreateContextProcPtr) (XvPortPtr port, @@ -91,8 +91,8 @@ extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen, extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id); -extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name, - char *busID, int major, int minor, +extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name, + const char *busID, int major, int minor, int patchLevel); #endif /* _XVMC_H */ diff --git a/xorg-server/Xi/devbell.c b/xorg-server/Xi/devbell.c index 202c8de18..07865d270 100644 --- a/xorg-server/Xi/devbell.c +++ b/xorg-server/Xi/devbell.c @@ -91,7 +91,7 @@ ProcXDeviceBell(ClientPtr client) int rc, base; int newpercent; CARD8 class; - pointer ctrl; + void *ctrl; BellProcPtr proc; REQUEST(xDeviceBellReq); @@ -117,7 +117,7 @@ ProcXDeviceBell(ClientPtr client) } base = k->ctrl.bell; proc = k->BellProc; - ctrl = (pointer) &(k->ctrl); + ctrl = (void *) &(k->ctrl); class = KbdFeedbackClass; } else if (stuff->feedbackclass == BellFeedbackClass) { @@ -130,7 +130,7 @@ ProcXDeviceBell(ClientPtr client) } base = b->ctrl.percent; proc = b->BellProc; - ctrl = (pointer) &(b->ctrl); + ctrl = (void *) &(b->ctrl); class = BellFeedbackClass; } else { diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index 4e180d755..8f804087b 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -1304,7 +1304,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, *mask = (*grab)->xi2mask; } else { - rc = dixLookupResourceByType((pointer *) win, listener->listener, + rc = dixLookupResourceByType((void **) win, listener->listener, listener->resource_type, serverClient, DixSendAccess); if (rc != Success) @@ -1739,7 +1739,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) eventinfo.device = device; eventinfo.event = ev; - CallCallbacks(&DeviceEventCallback, (pointer) &eventinfo); + CallCallbacks(&DeviceEventCallback, (void *) &eventinfo); } grab = device->deviceGrab.grab; @@ -2208,7 +2208,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, if (param->cursor == None) cursor = NullCursor; else { - rc = dixLookupResourceByType((pointer *) &cursor, param->cursor, + rc = dixLookupResourceByType((void **) &cursor, param->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = param->cursor; @@ -2307,7 +2307,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type, if (param->cursor == None) cursor = NullCursor; else { - rc = dixLookupResourceByType((pointer *) &cursor, param->cursor, + rc = dixLookupResourceByType((void **) &cursor, param->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = param->cursor; @@ -2450,7 +2450,7 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx) others->resource = FakeClientID(client->index); others->next = pWin->optional->inputMasks->inputClients; pWin->optional->inputMasks->inputClients = others; - if (!AddResource(others->resource, RT_INPUTCLIENT, (pointer) pWin)) + if (!AddResource(others->resource, RT_INPUTCLIENT, (void *) pWin)) goto bail; return Success; @@ -2556,7 +2556,7 @@ InputClientGone(WindowPtr pWin, XID id) else { other->resource = FakeClientID(0); if (!AddResource(other->resource, RT_INPUTCLIENT, - (pointer) pWin)) + (void *) pWin)) return BadAlloc; } } diff --git a/xorg-server/Xi/extinit.c b/xorg-server/Xi/extinit.c index a49a42152..9ebd733ab 100644 --- a/xorg-server/Xi/extinit.c +++ b/xorg-server/Xi/extinit.c @@ -381,7 +381,7 @@ DevPrivateKeyRec XIClientPrivateKeyRec; */ static void -XIClientCallback(CallbackListPtr *list, pointer closure, pointer data) +XIClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -1169,8 +1169,8 @@ IResetProc(ExtensionEntry * unused) EventSwapVector[DevicePropertyNotify] = NotImplemented; RestoreExtensionEvents(); - free(xi_all_devices.name); - free(xi_all_master_devices.name); + free((void *) xi_all_devices.name); + free((void *) xi_all_master_devices.name); XIBarrierReset(); } diff --git a/xorg-server/Xi/listdev.c b/xorg-server/Xi/listdev.c index bccfe35d1..e403a0cb5 100644 --- a/xorg-server/Xi/listdev.c +++ b/xorg-server/Xi/listdev.c @@ -119,7 +119,7 @@ SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size) */ static void -CopyDeviceName(char **namebuf, char *name) +CopyDeviceName(char **namebuf, const char *name) { char *nameptr = (char *) *namebuf; diff --git a/xorg-server/Xi/xibarriers.c b/xorg-server/Xi/xibarriers.c index a83457b10..8f277601d 100644 --- a/xorg-server/Xi/xibarriers.c +++ b/xorg-server/Xi/xibarriers.c @@ -694,7 +694,7 @@ BarrierFreeBarrier(void *data, XID id) return Success; } -static void add_master_func(pointer res, XID id, pointer devid) +static void add_master_func(void *res, XID id, void *devid) { struct PointerBarrier *b; struct PointerBarrierClient *barrier; @@ -711,7 +711,7 @@ static void add_master_func(pointer res, XID id, pointer devid) xorg_list_add(&pbd->entry, &barrier->per_device); } -static void remove_master_func(pointer res, XID id, pointer devid) +static void remove_master_func(void *res, XID id, void *devid) { struct PointerBarrierDevice *pbd; struct PointerBarrierClient *barrier; diff --git a/xorg-server/Xi/xichangecursor.c b/xorg-server/Xi/xichangecursor.c index 0be6bc0d4..7a1bb7a0d 100644 --- a/xorg-server/Xi/xichangecursor.c +++ b/xorg-server/Xi/xichangecursor.c @@ -96,7 +96,7 @@ ProcXIChangeCursor(ClientPtr client) pCursor = (CursorPtr) None; } else { - rc = dixLookupResourceByType((pointer *) &pCursor, stuff->cursor, + rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) return rc; diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c index ba5d99912..18936c587 100644 --- a/xorg-server/Xi/xiproperty.c +++ b/xorg-server/Xi/xiproperty.c @@ -723,10 +723,10 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, total_len = prop_value->size + len; if (mode == PropModeReplace || len > 0) { - pointer new_data = NULL, old_data = NULL; + void *new_data = NULL, *old_data = NULL; total_size = total_len * size_in_bytes; - new_value.data = (pointer) malloc(total_size); + new_value.data = (void *) malloc(total_size); if (!new_value.data && total_size) { if (add) XIDestroyDeviceProperty(prop); @@ -742,13 +742,13 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, old_data = NULL; break; case PropModeAppend: - new_data = (pointer) (((char *) new_value.data) + + new_data = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); old_data = new_value.data; break; case PropModePrepend: new_data = new_value.data; - old_data = (pointer) (((char *) new_value.data) + + old_data = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); break; } diff --git a/xorg-server/composite/compalloc.c b/xorg-server/composite/compalloc.c index baf59c5d9..9ed50becd 100644 --- a/xorg-server/composite/compalloc.c +++ b/xorg-server/composite/compalloc.c @@ -55,7 +55,7 @@ compScreenUpdate(ScreenPtr pScreen) } static void -compBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) +compBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) { CompScreenPtr cs = GetCompScreen(pScreen); diff --git a/xorg-server/composite/compext.c b/xorg-server/composite/compext.c index 2ca3db334..9240f42ab 100644 --- a/xorg-server/composite/compext.c +++ b/xorg-server/composite/compext.c @@ -67,7 +67,7 @@ typedef struct _CompositeClient { dixLookupPrivate(&(pClient)->devPrivates, CompositeClientPrivateKey)) static void -CompositeClientCallback(CallbackListPtr *list, pointer closure, pointer data) +CompositeClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -78,7 +78,7 @@ CompositeClientCallback(CallbackListPtr *list, pointer closure, pointer data) } static int -FreeCompositeClientWindow(pointer value, XID ccwid) +FreeCompositeClientWindow(void *value, XID ccwid) { WindowPtr pWin = value; @@ -87,7 +87,7 @@ FreeCompositeClientWindow(pointer value, XID ccwid) } static int -FreeCompositeClientSubwindows(pointer value, XID ccwid) +FreeCompositeClientSubwindows(void *value, XID ccwid) { WindowPtr pWin = value; @@ -96,7 +96,7 @@ FreeCompositeClientSubwindows(pointer value, XID ccwid) } static int -FreeCompositeClientOverlay(pointer value, XID ccwid) +FreeCompositeClientOverlay(void *value, XID ccwid) { CompOverlayClientPtr pOc = (CompOverlayClientPtr) value; @@ -139,7 +139,7 @@ ProcCompositeQueryVersion(ClientPtr client) #define VERIFY_WINDOW(pWindow, wid, client, mode) \ do { \ int err; \ - err = dixLookupResourceByType((pointer *) &pWindow, wid, \ + err = dixLookupResourceByType((void **) &pWindow, wid, \ RT_WINDOW, client, mode); \ if (err != Success) { \ client->errorValue = wid; \ @@ -226,7 +226,7 @@ ProcCompositeCreateRegionFromBorderClip(ClientPtr client) return BadAlloc; RegionTranslate(pRegion, -pWin->drawable.x, -pWin->drawable.y); - if (!AddResource(stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return Success; @@ -266,7 +266,7 @@ ProcCompositeNameWindowPixmap(ClientPtr client) ++pPixmap->refcnt; - if (!AddResource(stuff->pixmap, RT_PIXMAP, (pointer) pPixmap)) + if (!AddResource(stuff->pixmap, RT_PIXMAP, (void *) pPixmap)) return BadAlloc; return Success; @@ -332,12 +332,10 @@ ProcCompositeReleaseOverlayWindow(ClientPtr client) { REQUEST(xCompositeReleaseOverlayWindowReq); WindowPtr pWin; - ScreenPtr pScreen; CompOverlayClientPtr pOc; REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); VERIFY_WINDOW(pWin, stuff->window, client, DixGetAttrAccess); - pScreen = pWin->drawable.pScreen; /* * Has client queried a reference to the overlay window @@ -499,7 +497,7 @@ SProcCompositeDispatch(ClientPtr client) /** @see GetDefaultBytes */ static void -GetCompositeClientWindowBytes(pointer value, XID id, ResourceSizePtr size) +GetCompositeClientWindowBytes(void *value, XID id, ResourceSizePtr size) { WindowPtr window = value; @@ -753,13 +751,13 @@ PanoramiXCompositeNameWindowPixmap(ClientPtr client) return BadMatch; } - if (!AddResource(newPix->info[i].id, RT_PIXMAP, (pointer) pPixmap)) + if (!AddResource(newPix->info[i].id, RT_PIXMAP, (void *) pPixmap)) return BadAlloc; ++pPixmap->refcnt; } - if (!AddResource(stuff->pixmap, XRT_PIXMAP, (pointer) newPix)) + if (!AddResource(stuff->pixmap, XRT_PIXMAP, (void *) newPix)) return BadAlloc; return Success; @@ -796,7 +794,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client) } FOR_NSCREENS_BACKWARD(i) { - rc = dixLookupResourceByType((pointer *) &pWin, win->info[i].id, + rc = dixLookupResourceByType((void **) &pWin, win->info[i].id, RT_WINDOW, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->window; @@ -868,7 +866,6 @@ PanoramiXCompositeReleaseOverlayWindow(ClientPtr client) { REQUEST(xCompositeReleaseOverlayWindowReq); WindowPtr pWin; - ScreenPtr pScreen; CompOverlayClientPtr pOc; PanoramiXRes *win; int i, rc; @@ -888,7 +885,6 @@ PanoramiXCompositeReleaseOverlayWindow(ClientPtr client) client->errorValue = stuff->window; return rc; } - pScreen = pWin->drawable.pScreen; /* * Has client queried a reference to the overlay window diff --git a/xorg-server/composite/compinit.c b/xorg-server/composite/compinit.c index 3c910914e..1db9e0bf5 100644 --- a/xorg-server/composite/compinit.c +++ b/xorg-server/composite/compinit.c @@ -119,7 +119,7 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) pScreen->backingStoreSupport != NotUseful) { if (pWin->backingStore != NotUseful && !pWin->backStorage) { compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); - pWin->backStorage = (pointer) (intptr_t) 1; + pWin->backStorage = (void *) (intptr_t) 1; } else if (pWin->backingStore == NotUseful && pWin->backStorage) { compUnredirectWindow(serverClient, pWin, diff --git a/xorg-server/composite/compint.h b/xorg-server/composite/compint.h index 45b5824a9..12dc8b3f7 100644 --- a/xorg-server/composite/compint.h +++ b/xorg-server/composite/compint.h @@ -319,7 +319,7 @@ WindowPtr CompositeRealChildHead(WindowPtr pWin); int - DeleteWindowNoInputDevices(pointer value, XID wid); + DeleteWindowNoInputDevices(void *value, XID wid); int diff --git a/xorg-server/composite/compoverlay.c b/xorg-server/composite/compoverlay.c index ae3dcb61d..7781a554f 100644 --- a/xorg-server/composite/compoverlay.c +++ b/xorg-server/composite/compoverlay.c @@ -118,7 +118,7 @@ compCreateOverlayClient(ScreenPtr pScreen, ClientPtr pClient) * Create a resource for this element so it can be deleted * when the client goes away. */ - if (!AddResource(pOc->resource, CompositeClientOverlayType, (pointer) pOc)) + if (!AddResource(pOc->resource, CompositeClientOverlayType, (void *) pOc)) return NULL; return pOc; @@ -156,7 +156,7 @@ compCreateOverlayWindow(ScreenPtr pScreen) if (pWin == NULL) return FALSE; - if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer) pWin)) + if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *) pWin)) return FALSE; MapWindow(pWin, serverClient); diff --git a/xorg-server/composite/compwindow.c b/xorg-server/composite/compwindow.c index 0be7a1b34..8dce21d9b 100644 --- a/xorg-server/composite/compwindow.c +++ b/xorg-server/composite/compwindow.c @@ -53,7 +53,7 @@ #ifdef COMPOSITE_DEBUG static int -compCheckWindow(WindowPtr pWin, pointer data) +compCheckWindow(WindowPtr pWin, void *data) { ScreenPtr pScreen = pWin->drawable.pScreen; PixmapPtr pWinPixmap = (*pScreen->GetWindowPixmap) (pWin); @@ -92,7 +92,7 @@ typedef struct _compPixmapVisit { } CompPixmapVisitRec, *CompPixmapVisitPtr; static Bool -compRepaintBorder(ClientPtr pClient, pointer closure) +compRepaintBorder(ClientPtr pClient, void *closure) { WindowPtr pWindow; int rc = @@ -111,7 +111,7 @@ compRepaintBorder(ClientPtr pClient, pointer closure) } static int -compSetPixmapVisitWindow(WindowPtr pWindow, pointer data) +compSetPixmapVisitWindow(WindowPtr pWindow, void *data) { CompPixmapVisitPtr pVisit = (CompPixmapVisitPtr) data; ScreenPtr pScreen = pWindow->drawable.pScreen; @@ -128,7 +128,7 @@ compSetPixmapVisitWindow(WindowPtr pWindow, pointer data) SetBorderSize(pWindow); if (HasBorder(pWindow)) QueueWorkProc(compRepaintBorder, serverClient, - (pointer) (intptr_t) pWindow->drawable.id); + (void *) (intptr_t) pWindow->drawable.id); return WT_WALKCHILDREN; } @@ -139,7 +139,7 @@ compSetPixmap(WindowPtr pWindow, PixmapPtr pPixmap) visitRec.pWindow = pWindow; visitRec.pPixmap = pPixmap; - TraverseTree(pWindow, compSetPixmapVisitWindow, (pointer) &visitRec); + TraverseTree(pWindow, compSetPixmapVisitWindow, (void *) &visitRec); compCheckTree(pWindow->drawable.pScreen); } diff --git a/xorg-server/config/dbus-core.c b/xorg-server/config/dbus-core.c index 324258718..768a98454 100644 --- a/xorg-server/config/dbus-core.c +++ b/xorg-server/config/dbus-core.c @@ -45,10 +45,10 @@ struct dbus_core_info { }; static struct dbus_core_info bus_info; -static CARD32 reconnect_timer(OsTimerPtr timer, CARD32 time, pointer arg); +static CARD32 reconnect_timer(OsTimerPtr timer, CARD32 time, void *arg); static void -wakeup_handler(pointer data, int err, pointer read_mask) +wakeup_handler(void *data, int err, void *read_mask) { struct dbus_core_info *info = data; @@ -63,7 +63,7 @@ wakeup_handler(pointer data, int err, pointer read_mask) } static void -block_handler(pointer data, struct timeval **tv, pointer read_mask) +block_handler(void *data, struct timeval **tv, void *read_mask) { } @@ -185,7 +185,7 @@ connect_to_bus(void) } static CARD32 -reconnect_timer(OsTimerPtr timer, CARD32 time, pointer arg) +reconnect_timer(OsTimerPtr timer, CARD32 time, void *arg) { if (connect_to_bus()) { TimerFree(bus_info.timer); diff --git a/xorg-server/config/udev.c b/xorg-server/config/udev.c index b55b78ec5..436b8f038 100644 --- a/xorg-server/config/udev.c +++ b/xorg-server/config/udev.c @@ -137,11 +137,13 @@ device_added(struct udev_device *udev_device) /* construct USB ID in lowercase hex - "0000:ffff" */ if (product && sscanf(product, "%*x/%4x/%4x/%*x", &usb_vendor, &usb_model) == 2) { - if (asprintf(&attrs.usb_id, "%04x:%04x", usb_vendor, usb_model) + char *usb_id; + if (asprintf(&usb_id, "%04x:%04x", usb_vendor, usb_model) == -1) - attrs.usb_id = NULL; + usb_id = NULL; else LOG_PROPERTY(ppath, "PRODUCT", product); + attrs.usb_id = usb_id; } } if (!name) @@ -240,16 +242,16 @@ device_added(struct udev_device *udev_device) free(config_info); input_option_free_list(&input_options); - free(attrs.usb_id); - free(attrs.pnp_id); - free(attrs.product); - free(attrs.device); - free(attrs.vendor); + free((void *) attrs.usb_id); + free((void *) attrs.pnp_id); + free((void *) attrs.product); + free((void *) attrs.device); + free((void *) attrs.vendor); if (attrs.tags) { - char **tag = attrs.tags; + const char **tag = attrs.tags; while (*tag) { - free(*tag); + free((void *) *tag); tag++; } free(attrs.tags); @@ -289,7 +291,7 @@ device_removed(struct udev_device *device) } static void -wakeup_handler(pointer data, int err, pointer read_mask) +wakeup_handler(void *data, int err, void *read_mask) { int udev_fd = udev_monitor_get_fd(udev_monitor); struct udev_device *udev_device; @@ -322,7 +324,7 @@ wakeup_handler(pointer data, int err, pointer read_mask) } static void -block_handler(pointer data, struct timeval **tv, pointer read_mask) +block_handler(void *data, struct timeval **tv, void *read_mask) { } diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index 8f823863d..234cf21b2 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.15.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2013-12-27" -RELEASE_NAME="Egg Nog" +AC_INIT([xorg-server], 1.15.99.900, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2014-01-09" +RELEASE_NAME="Golden Gaytime" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AC_USE_SYSTEM_EXTENSIONS @@ -632,7 +632,7 @@ AC_ARG_ENABLE(linux_apm, AC_HELP_STRING([--disable-linux-apm], [Disable building dnl DDXes. AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) -AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto]) +AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=no]) AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) diff --git a/xorg-server/damageext/damageext.c b/xorg-server/damageext/damageext.c index 8e6d97b9e..bc7840416 100644 --- a/xorg-server/damageext/damageext.c +++ b/xorg-server/damageext/damageext.c @@ -243,7 +243,7 @@ DamageExtCreate(DrawablePtr pDrawable, DamageReportLevel level, return NULL; } - if (!AddResource(id, DamageExtType, (pointer) pDamageExt)) + if (!AddResource(id, DamageExtType, (void *) pDamageExt)) return NULL; DamageExtRegister(pDrawable, pDamageExt->pDamage, @@ -567,7 +567,7 @@ SProcDamageDispatch(ClientPtr client) } static void -DamageClientCallback(CallbackListPtr *list, pointer closure, pointer data) +DamageClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -585,7 +585,7 @@ DamageResetProc(ExtensionEntry * extEntry) } static int -FreeDamageExt(pointer value, XID did) +FreeDamageExt(void *value, XID did) { DamageExtPtr pDamageExt = (DamageExtPtr) value; diff --git a/xorg-server/damageext/damageextint.h b/xorg-server/damageext/damageextint.h index e50149501..7a7096d27 100644 --- a/xorg-server/damageext/damageextint.h +++ b/xorg-server/damageext/damageextint.h @@ -58,7 +58,7 @@ typedef struct _DamageExt { } DamageExtRec, *DamageExtPtr; #define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \ - int rc = dixLookupResourceByType((pointer *)&(pDamageExt), rid, \ + int rc = dixLookupResourceByType((void **)&(pDamageExt), rid, \ DamageExtType, client, mode); \ if (rc != Success) \ return rc; \ diff --git a/xorg-server/dbe/dbe.c b/xorg-server/dbe/dbe.c index e8fccdc69..d64fb4069 100644 --- a/xorg-server/dbe/dbe.c +++ b/xorg-server/dbe/dbe.c @@ -322,7 +322,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client) if (status == Success) { pDbeWindowPriv->IDs[add_index] = stuff->buffer; if (!AddResource(stuff->buffer, dbeWindowPrivResType, - (pointer) pDbeWindowPriv)) { + (void *) pDbeWindowPriv)) { pDbeWindowPriv->IDs[add_index] = DBE_FREE_ID_ELEMENT; if (pDbeWindowPriv->nBufferIDs == 0) { @@ -378,12 +378,12 @@ ProcDbeDeallocateBackBufferName(ClientPtr client) REQUEST(xDbeDeallocateBackBufferNameReq); DbeWindowPrivPtr pDbeWindowPriv; int rc, i; - pointer val; + void *val; REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq); /* Buffer name must be valid */ - rc = dixLookupResourceByType((pointer *) &pDbeWindowPriv, stuff->buffer, + rc = dixLookupResourceByType((void **) &pDbeWindowPriv, stuff->buffer, dbeWindowPrivResType, client, DixDestroyAccess); if (rc != Success) @@ -720,7 +720,7 @@ ProcDbeGetBackBufferAttributes(ClientPtr client) REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); - rc = dixLookupResourceByType((pointer *) &pDbeWindowPriv, stuff->buffer, + rc = dixLookupResourceByType((void **) &pDbeWindowPriv, stuff->buffer, dbeWindowPrivResType, client, DixGetAttrAccess); if (rc == Success) { @@ -1123,7 +1123,7 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC) * *****************************************************************************/ static int -DbeDrawableDelete(pointer pDrawable, XID id) +DbeDrawableDelete(void *pDrawable, XID id) { return Success; @@ -1141,7 +1141,7 @@ DbeDrawableDelete(pointer pDrawable, XID id) * *****************************************************************************/ static int -DbeWindowPrivDelete(pointer pDbeWinPriv, XID id) +DbeWindowPrivDelete(void *pDbeWinPriv, XID id) { DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv = (DbeWindowPrivPtr) pDbeWinPriv; diff --git a/xorg-server/dbe/midbe.c b/xorg-server/dbe/midbe.c index 3663fddcc..0479ecc5e 100644 --- a/xorg-server/dbe/midbe.c +++ b/xorg-server/dbe/midbe.c @@ -202,7 +202,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) /* Associate the new ID with an existing pixmap. */ if (!AddResource(bufId, dbeDrawableResType, - (pointer) pDbeWindowPriv->pBackBuffer)) { + (void *) pDbeWindowPriv->pBackBuffer)) { return BadAlloc; } @@ -230,7 +230,7 @@ miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv) for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) { ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType, - (pointer) pDbeWindowPriv->pBackBuffer); + (void *) pDbeWindowPriv->pBackBuffer); } } /* miDbeAliasBuffers() */ diff --git a/xorg-server/dix/colormap.c b/xorg-server/dix/colormap.c index 9feb3e159..4107df98d 100644 --- a/xorg-server/dix/colormap.c +++ b/xorg-server/dix/colormap.c @@ -371,7 +371,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, } pmap->flags |= BeingCreated; - if (!AddResource(mid, RT_COLORMAP, (pointer) pmap)) + if (!AddResource(mid, RT_COLORMAP, (void *) pmap)) return BadAlloc; /* @@ -401,7 +401,7 @@ CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, * \param value must conform to DeleteType */ int -FreeColormap(pointer value, XID mid) +FreeColormap(void *value, XID mid) { int i; EntryPtr pent; @@ -409,7 +409,7 @@ FreeColormap(pointer value, XID mid) if (CLIENT_ID(mid) != SERVER_ID) { (*pmap->pScreen->UninstallColormap) (pmap); - WalkTree(pmap->pScreen, (VisitWindowProcPtr) TellNoMap, (pointer) &mid); + WalkTree(pmap->pScreen, (VisitWindowProcPtr) TellNoMap, (void *) &mid); } /* This is the device's chance to undo anything it needs to, especially @@ -478,7 +478,7 @@ TellNoMap(WindowPtr pwin, Colormap * pmid) /* Tell window that pmid got uninstalled */ int -TellLostMap(WindowPtr pwin, pointer value) +TellLostMap(WindowPtr pwin, void *value) { Colormap *pmid = (Colormap *) value; @@ -503,7 +503,7 @@ TellLostMap(WindowPtr pwin, pointer value) /* Tell window that pmid got installed */ int -TellGainedMap(WindowPtr pwin, pointer value) +TellGainedMap(WindowPtr pwin, void *value) { Colormap *pmid = (Colormap *) value; @@ -849,7 +849,7 @@ AllocColor(ColormapPtr pmap, pmap->pVisual->vid == pmap->pScreen->rootVisual) { ColormapPtr prootmap; - dixLookupResourceByType((pointer *) &prootmap, + dixLookupResourceByType((void **) &prootmap, pmap->pScreen->defColormap, RT_COLORMAP, clients[client], DixReadAccess); @@ -867,7 +867,7 @@ AllocColor(ColormapPtr pmap, pmap->pVisual->vid == pmap->pScreen->rootVisual) { ColormapPtr prootmap; - dixLookupResourceByType((pointer *) &prootmap, + dixLookupResourceByType((void **) &prootmap, pmap->pScreen->defColormap, RT_COLORMAP, clients[client], DixReadAccess); @@ -921,7 +921,7 @@ AllocColor(ColormapPtr pmap, } pcr->mid = pmap->mid; pcr->client = client; - if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer) pcr)) + if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *) pcr)) return BadAlloc; } return Success; @@ -1467,9 +1467,9 @@ FreePixels(ColormapPtr pmap, int client) * \unused fakeid */ int -FreeClientPixels(pointer value, XID fakeid) +FreeClientPixels(void *value, XID fakeid) { - pointer pmap; + void *pmap; colorResource *pcr = value; int rc; @@ -1536,7 +1536,7 @@ AllocColorCells(int client, ColormapPtr pmap, int colors, int planes, if ((ok == Success) && pcr) { pcr->mid = pmap->mid; pcr->client = client; - if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer) pcr)) + if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *) pcr)) ok = BadAlloc; } else @@ -1618,7 +1618,7 @@ AllocColorPlanes(int client, ColormapPtr pmap, int colors, if ((ok == Success) && pcr) { pcr->mid = pmap->mid; pcr->client = client; - if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer) pcr)) + if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *) pcr)) ok = BadAlloc; } else @@ -2496,7 +2496,7 @@ struct colormap_lookup_data { }; static void -_colormap_find_resource(pointer value, XID id, pointer cdata) +_colormap_find_resource(void *value, XID id, void *cdata) { struct colormap_lookup_data *cmap_data = cdata; VisualPtr visuals = cmap_data->visuals; diff --git a/xorg-server/dix/cursor.c b/xorg-server/dix/cursor.c index 8cc54bd1f..56c560640 100644 --- a/xorg-server/dix/cursor.c +++ b/xorg-server/dix/cursor.c @@ -104,7 +104,7 @@ FreeCursorBits(CursorBitsPtr bits) * \param value must conform to DeleteType */ int -FreeCursor(pointer value, XID cid) +FreeCursor(void *value, XID cid) { int nscr; CursorPtr pCurs = (CursorPtr) value; @@ -319,13 +319,13 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, CursorPtr pCurs; GlyphSharePtr pShare; - rc = dixLookupResourceByType((pointer *) &sourcefont, source, RT_FONT, + rc = dixLookupResourceByType((void **) &sourcefont, source, RT_FONT, client, DixUseAccess); if (rc != Success) { client->errorValue = source; return rc; } - rc = dixLookupResourceByType((pointer *) &maskfont, mask, RT_FONT, client, + rc = dixLookupResourceByType((void **) &maskfont, mask, RT_FONT, client, DixUseAccess); if (rc != Success && mask != None) { client->errorValue = mask; @@ -486,7 +486,7 @@ CreateRootCursor(char *unused1, unsigned int unused2) if (err != Success) return NullCursor; - err = dixLookupResourceByType((pointer *) &cursorfont, fontID, RT_FONT, + err = dixLookupResourceByType((void **) &cursorfont, fontID, RT_FONT, serverClient, DixReadAccess); if (err != Success) return NullCursor; @@ -494,7 +494,7 @@ CreateRootCursor(char *unused1, unsigned int unused2) &curs, serverClient, (XID) 0) != Success) return NullCursor; - if (!AddResource(FakeClientID(0), RT_CURSOR, (pointer) curs)) + if (!AddResource(FakeClientID(0), RT_CURSOR, (void *) curs)) return NullCursor; return curs; diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index 1f5193c1b..1d6c06d41 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -387,7 +387,7 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) } else { if (dev->coreEvents) - other = (IsPointerDevice(dev)) ? inputInfo.pointer : + other = (IsPointerDevice(dev)) ? inputInfo.pointer: inputInfo.keyboard; else other = NULL; /* auto-float non-core devices */ @@ -587,7 +587,7 @@ ActivateDevice(DeviceIntPtr dev, BOOL sendevent) * The actual task of ringing the bell is the job of the DDX. */ static void -CoreKeyboardBell(int volume, DeviceIntPtr pDev, pointer arg, int something) +CoreKeyboardBell(int volume, DeviceIntPtr pDev, void *arg, int something) { KeybdCtrl *ctrl = arg; @@ -751,7 +751,7 @@ InitAndStartDevices(void) * Free the given device class and reset the pointer to NULL. */ static void -FreeDeviceClass(int type, pointer *class) +FreeDeviceClass(int type, void **class) { if (!(*class)) return; @@ -819,7 +819,7 @@ FreeDeviceClass(int type, pointer *class) } static void -FreeFeedbackClass(int type, pointer *class) +FreeFeedbackClass(int type, void **class) { if (!(*class)) return; @@ -907,19 +907,19 @@ FreeAllDeviceClasses(ClassesPtr classes) if (!classes) return; - FreeDeviceClass(KeyClass, (pointer) &classes->key); - FreeDeviceClass(ValuatorClass, (pointer) &classes->valuator); - FreeDeviceClass(XITouchClass, (pointer) &classes->touch); - FreeDeviceClass(ButtonClass, (pointer) &classes->button); - FreeDeviceClass(FocusClass, (pointer) &classes->focus); - FreeDeviceClass(ProximityClass, (pointer) &classes->proximity); + FreeDeviceClass(KeyClass, (void *) &classes->key); + FreeDeviceClass(ValuatorClass, (void *) &classes->valuator); + FreeDeviceClass(XITouchClass, (void *) &classes->touch); + FreeDeviceClass(ButtonClass, (void *) &classes->button); + FreeDeviceClass(FocusClass, (void *) &classes->focus); + FreeDeviceClass(ProximityClass, (void *) &classes->proximity); - FreeFeedbackClass(KbdFeedbackClass, (pointer) &classes->kbdfeed); - FreeFeedbackClass(PtrFeedbackClass, (pointer) &classes->ptrfeed); - FreeFeedbackClass(IntegerFeedbackClass, (pointer) &classes->intfeed); - FreeFeedbackClass(StringFeedbackClass, (pointer) &classes->stringfeed); - FreeFeedbackClass(BellFeedbackClass, (pointer) &classes->bell); - FreeFeedbackClass(LedFeedbackClass, (pointer) &classes->leds); + FreeFeedbackClass(KbdFeedbackClass, (void *) &classes->kbdfeed); + FreeFeedbackClass(PtrFeedbackClass, (void *) &classes->ptrfeed); + FreeFeedbackClass(IntegerFeedbackClass, (void *) &classes->intfeed); + FreeFeedbackClass(StringFeedbackClass, (void *) &classes->stringfeed); + FreeFeedbackClass(BellFeedbackClass, (void *) &classes->bell); + FreeFeedbackClass(LedFeedbackClass, (void *) &classes->leds); } @@ -956,7 +956,7 @@ CloseDevice(DeviceIntPtr dev) while (dev->xkb_interest) XkbRemoveResourceClient((DevicePtr) dev, dev->xkb_interest->resource); - free(dev->name); + free((void *) dev->name); classes = (ClassesPtr) &dev->key; FreeAllDeviceClasses(classes); @@ -2736,6 +2736,7 @@ AllocDevicePair(ClientPtr client, const char *name, { DeviceIntPtr pointer; DeviceIntPtr keyboard; + char *dev_name; *ptr = *keybd = NULL; @@ -2746,12 +2747,12 @@ AllocDevicePair(ClientPtr client, const char *name, if (!pointer) return BadAlloc; - if (asprintf(&pointer->name, "%s pointer", name) == -1) { - pointer->name = NULL; + if (asprintf(&dev_name, "%s pointer", name) == -1) { RemoveDevice(pointer, FALSE); return BadAlloc; } + pointer->name = dev_name; pointer->public.processInputProc = ProcessOtherEvent; pointer->public.realInputProc = ProcessOtherEvent; @@ -2772,13 +2773,13 @@ AllocDevicePair(ClientPtr client, const char *name, return BadAlloc; } - if (asprintf(&keyboard->name, "%s keyboard", name) == -1) { - keyboard->name = NULL; + if (asprintf(&dev_name, "%s keyboard", name) == -1) { RemoveDevice(keyboard, FALSE); RemoveDevice(pointer, FALSE); return BadAlloc; } + keyboard->name = dev_name; keyboard->public.processInputProc = ProcessOtherEvent; keyboard->public.realInputProc = ProcessOtherEvent; diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index a034a7bc5..dbaaee907 100644..100755 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -504,7 +504,7 @@ Dispatch(void) }
static int VendorRelease = VENDOR_RELEASE;
-static char *VendorString = VENDOR_NAME;
+static const char *VendorString = VENDOR_NAME;
void
SetVendorRelease(int release)
@@ -513,7 +513,7 @@ SetVendorRelease(int release) }
void
-SetVendorString(char *string)
+SetVendorString(const char *string)
{
VendorString = string;
}
@@ -686,7 +686,7 @@ ProcCreateWindow(ClientPtr client) Mask mask = pWin->eventMask;
pWin->eventMask = 0; /* subterfuge in case AddResource fails */
- if (!AddResource(stuff->wid, RT_WINDOW, (pointer) pWin))
+ if (!AddResource(stuff->wid, RT_WINDOW, (void *) pWin))
return BadAlloc;
pWin->eventMask = mask;
}
@@ -1116,7 +1116,7 @@ ProcGrabServer(ClientPtr client) grabinfo.client = client;
grabinfo.grabstate = SERVER_GRABBED;
- CallCallbacks(&ServerGrabCallback, (pointer) &grabinfo);
+ CallCallbacks(&ServerGrabCallback, (void *) &grabinfo);
}
return Success;
@@ -1143,7 +1143,7 @@ UngrabServer(ClientPtr client) grabinfo.client = client;
grabinfo.grabstate = SERVER_UNGRABBED;
- CallCallbacks(&ServerGrabCallback, (pointer) &grabinfo);
+ CallCallbacks(&ServerGrabCallback, (void *) &grabinfo);
}
}
@@ -1254,7 +1254,7 @@ ProcCloseFont(ClientPtr client) REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- rc = dixLookupResourceByType((pointer *) &pFont, stuff->id, RT_FONT,
+ rc = dixLookupResourceByType((void **) &pFont, stuff->id, RT_FONT,
client, DixDestroyAccess);
if (rc == Success) {
FreeResource(stuff->id, RT_NONE);
@@ -1381,7 +1381,7 @@ ProcListFontsWithInfo(ClientPtr client) * \param value must conform to DeleteType
*/
int
-dixDestroyPixmap(pointer value, XID pid)
+dixDestroyPixmap(void *value, XID pid)
{
PixmapPtr pPixmap = (PixmapPtr) value;
@@ -1448,7 +1448,7 @@ ProcCreatePixmap(ClientPtr client) (*pDraw->pScreen->DestroyPixmap) (pMap);
return rc;
}
- if (AddResource(stuff->pid, RT_PIXMAP, (pointer) pMap))
+ if (AddResource(stuff->pid, RT_PIXMAP, (void *) pMap))
return Success;
}
return BadAlloc;
@@ -1463,7 +1463,7 @@ ProcFreePixmap(ClientPtr client) REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- rc = dixLookupResourceByType((pointer *) &pMap, stuff->id, RT_PIXMAP,
+ rc = dixLookupResourceByType((void **) &pMap, stuff->id, RT_PIXMAP,
client, DixDestroyAccess);
if (rc == Success) {
FreeResource(stuff->id, RT_NONE);
@@ -1500,7 +1500,7 @@ ProcCreateGC(ClientPtr client) stuff->gc, client);
if (error != Success)
return error;
- if (!AddResource(stuff->gc, RT_GC, (pointer) pGC))
+ if (!AddResource(stuff->gc, RT_GC, (void *) pGC))
return BadAlloc;
return Success;
}
@@ -2167,7 +2167,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, y + linesDone,
width,
nlines,
- format, planemask, (pointer) pBuf);
+ format, planemask, (void *) pBuf);
if (pVisibleRegion)
XaceCensorImage(client, pVisibleRegion, widthBytesLine,
pDraw, x, y + linesDone, width,
@@ -2194,7 +2194,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, y + linesDone,
width,
nlines,
- format, plane, (pointer) pBuf);
+ format, plane, (void *) pBuf);
if (pVisibleRegion)
XaceCensorImage(client, pVisibleRegion,
widthBytesLine,
@@ -2354,7 +2354,7 @@ ProcFreeColormap(ClientPtr client) REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- rc = dixLookupResourceByType((pointer *) &pmap, stuff->id, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pmap, stuff->id, RT_COLORMAP,
client, DixDestroyAccess);
if (rc == Success) {
/* Freeing a default colormap is a no-op */
@@ -2380,7 +2380,7 @@ ProcCopyColormapAndFree(ClientPtr client) REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
mid = stuff->mid;
LEGAL_NEW_RESOURCE(mid, client);
- rc = dixLookupResourceByType((pointer *) &pSrcMap, stuff->srcCmap,
+ rc = dixLookupResourceByType((void **) &pSrcMap, stuff->srcCmap,
RT_COLORMAP, client,
DixReadAccess | DixRemoveAccess);
if (rc == Success)
@@ -2398,7 +2398,7 @@ ProcInstallColormap(ClientPtr client) REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->id, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->id, RT_COLORMAP,
client, DixInstallAccess);
if (rc != Success)
goto out;
@@ -2427,7 +2427,7 @@ ProcUninstallColormap(ClientPtr client) REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->id, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->id, RT_COLORMAP,
client, DixUninstallAccess);
if (rc != Success)
goto out;
@@ -2495,7 +2495,7 @@ ProcAllocColor(ClientPtr client) REQUEST(xAllocColorReq);
REQUEST_SIZE_MATCH(xAllocColorReq);
- rc = dixLookupResourceByType((pointer *) &pmap, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pmap, stuff->cmap, RT_COLORMAP,
client, DixAddAccess);
if (rc == Success) {
xAllocColorReply acr;
@@ -2531,7 +2531,7 @@ ProcAllocNamedColor(ClientPtr client) REQUEST(xAllocNamedColorReq);
REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP,
client, DixAddAccess);
if (rc == Success) {
xAllocNamedColorReply ancr;
@@ -2576,7 +2576,7 @@ ProcAllocColorCells(ClientPtr client) REQUEST(xAllocColorCellsReq);
REQUEST_SIZE_MATCH(xAllocColorCellsReq);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP,
client, DixAddAccess);
if (rc == Success) {
int npixels, nmasks;
@@ -2636,7 +2636,7 @@ ProcAllocColorPlanes(ClientPtr client) REQUEST(xAllocColorPlanesReq);
REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP,
client, DixAddAccess);
if (rc == Success) {
xAllocColorPlanesReply acpr;
@@ -2698,7 +2698,7 @@ ProcFreeColors(ClientPtr client) REQUEST(xFreeColorsReq);
REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP,
client, DixRemoveAccess);
if (rc == Success) {
int count;
@@ -2724,7 +2724,7 @@ ProcStoreColors(ClientPtr client) REQUEST(xStoreColorsReq);
REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP,
client, DixWriteAccess);
if (rc == Success) {
int count;
@@ -2750,7 +2750,7 @@ ProcStoreNamedColor(ClientPtr client) REQUEST(xStoreNamedColorReq);
REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP,
client, DixWriteAccess);
if (rc == Success) {
xColorItem def;
@@ -2778,7 +2778,7 @@ ProcQueryColors(ClientPtr client) REQUEST(xQueryColorsReq);
REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP,
client, DixReadAccess);
if (rc == Success) {
int count;
@@ -2825,7 +2825,7 @@ ProcLookupColor(ClientPtr client) REQUEST(xLookupColorReq);
REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes);
- rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP,
+ rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, RT_COLORMAP,
client, DixReadAccess);
if (rc == Success) {
CARD16 exactRed, exactGreen, exactBlue;
@@ -2876,7 +2876,7 @@ ProcCreateCursor(ClientPtr client) REQUEST_SIZE_MATCH(xCreateCursorReq);
LEGAL_NEW_RESOURCE(stuff->cid, client);
- rc = dixLookupResourceByType((pointer *) &src, stuff->source, RT_PIXMAP,
+ rc = dixLookupResourceByType((void **) &src, stuff->source, RT_PIXMAP,
client, DixReadAccess);
if (rc != Success) {
client->errorValue = stuff->source;
@@ -2888,7 +2888,7 @@ ProcCreateCursor(ClientPtr client) /* Find and validate cursor mask pixmap, if one is provided */
if (stuff->mask != None) {
- rc = dixLookupResourceByType((pointer *) &msk, stuff->mask, RT_PIXMAP,
+ rc = dixLookupResourceByType((void **) &msk, stuff->mask, RT_PIXMAP,
client, DixReadAccess);
if (rc != Success) {
client->errorValue = stuff->mask;
@@ -2920,7 +2920,7 @@ ProcCreateCursor(ClientPtr client) }
(*src->drawable.pScreen->GetImage) ((DrawablePtr) src, 0, 0, width, height,
- XYPixmap, 1, (pointer) srcbits);
+ XYPixmap, 1, (void *) srcbits);
if (msk == (PixmapPtr) NULL) {
unsigned char *bits = mskbits;
@@ -2932,7 +2932,7 @@ ProcCreateCursor(ClientPtr client) memset((char *) mskbits, 0, n);
(*msk->drawable.pScreen->GetImage) ((DrawablePtr) msk, 0, 0, width,
height, XYPixmap, 1,
- (pointer) mskbits);
+ (void *) mskbits);
}
cm.width = width;
cm.height = height;
@@ -2945,7 +2945,7 @@ ProcCreateCursor(ClientPtr client) if (rc != Success)
goto bail;
- if (!AddResource(stuff->cid, RT_CURSOR, (pointer) pCursor)) {
+ if (!AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) {
rc = BadAlloc;
goto bail;
}
@@ -2975,7 +2975,7 @@ ProcCreateGlyphCursor(ClientPtr client) &pCursor, client, stuff->cid);
if (res != Success)
return res;
- if (AddResource(stuff->cid, RT_CURSOR, (pointer) pCursor))
+ if (AddResource(stuff->cid, RT_CURSOR, (void *) pCursor))
return Success;
return BadAlloc;
}
@@ -2989,7 +2989,7 @@ ProcFreeCursor(ClientPtr client) REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- rc = dixLookupResourceByType((pointer *) &pCursor, stuff->id, RT_CURSOR,
+ rc = dixLookupResourceByType((void **) &pCursor, stuff->id, RT_CURSOR,
client, DixDestroyAccess);
if (rc == Success) {
FreeResource(stuff->id, RT_NONE);
@@ -3138,10 +3138,10 @@ ProcChangeHosts(ClientPtr client) if (stuff->mode == HostInsert)
return AddHost(client, (int) stuff->hostFamily,
- stuff->hostLength, (pointer) &stuff[1]);
+ stuff->hostLength, (void *) &stuff[1]);
if (stuff->mode == HostDelete)
return RemoveHost(client, (int) stuff->hostFamily,
- stuff->hostLength, (pointer) &stuff[1]);
+ stuff->hostLength, (void *) &stuff[1]);
client->errorValue = stuff->mode;
return BadValue;
}
@@ -3152,7 +3152,7 @@ ProcListHosts(ClientPtr client) xListHostsReply reply;
int len, nHosts, result;
BOOL enabled;
- pointer pdata;
+ void *pdata;
/* REQUEST(xListHostsReq); */
@@ -3392,7 +3392,7 @@ CloseDownClient(ClientPtr client) clientinfo.client = client;
clientinfo.prefix = (xConnSetupPrefix *) NULL;
clientinfo.setup = (xConnSetup *) NULL;
- CallCallbacks((&ClientStateCallback), (pointer) &clientinfo);
+ CallCallbacks((&ClientStateCallback), (void *) &clientinfo);
}
}
client->clientGone = TRUE; /* so events aren't sent to client */
@@ -3422,7 +3422,7 @@ CloseDownClient(ClientPtr client) clientinfo.client = client;
clientinfo.prefix = (xConnSetupPrefix *) NULL;
clientinfo.setup = (xConnSetup *) NULL;
- CallCallbacks((&ClientStateCallback), (pointer) &clientinfo);
+ CallCallbacks((&ClientStateCallback), (void *) &clientinfo);
}
TouchListenerGone(client->clientAsMask);
FreeClientResources(client);
@@ -3457,7 +3457,7 @@ KillAllClients(void) }
void
-InitClient(ClientPtr client, int i, pointer ospriv)
+InitClient(ClientPtr client, int i, void *ospriv)
{
client->index = i;
client->clientAsMask = ((Mask) i) << CLIENTOFFSET;
@@ -3479,7 +3479,7 @@ InitClient(ClientPtr client, int i, pointer ospriv) *************************/
ClientPtr
-NextAvailableClient(pointer ospriv)
+NextAvailableClient(void *ospriv)
{
int i;
ClientPtr client;
@@ -3519,7 +3519,7 @@ NextAvailableClient(pointer ospriv) clientinfo.client = client;
clientinfo.prefix = (xConnSetupPrefix *) NULL;
clientinfo.setup = (xConnSetup *) NULL;
- CallCallbacks((&ClientStateCallback), (pointer) &clientinfo);
+ CallCallbacks((&ClientStateCallback), (void *) &clientinfo);
}
return client;
}
@@ -3639,7 +3639,7 @@ SendConnSetup(ClientPtr client, const char *reason) clientinfo.client = client;
clientinfo.prefix = lconnSetupPrefix;
clientinfo.setup = (xConnSetup *) lConnectionInfo;
- CallCallbacks((&ClientStateCallback), (pointer) &clientinfo);
+ CallCallbacks((&ClientStateCallback), (void *) &clientinfo);
}
return Success;
}
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c index dd7700860..6260f48b9 100644..100755 --- a/xorg-server/dix/dixfonts.c +++ b/xorg-server/dix/dixfonts.c @@ -70,7 +70,7 @@ Equipment Corporation. #include "xf86bigfontsrv.h" #endif -extern pointer fosNaturalParams; +extern void *fosNaturalParams; extern FontPtr defaultFont; static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; @@ -128,7 +128,7 @@ dixGetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, * adding RT_FONT prevents conflict with default cursor font */ Bool -SetDefaultFont(char *defaultfontname) +SetDefaultFont(const char *defaultfontname) { int err; FontPtr pf; @@ -140,7 +140,7 @@ SetDefaultFont(char *defaultfontname) (unsigned) strlen(defaultfontname), defaultfontname); if (err != Success) return FALSE; - err = dixLookupResourceByType((pointer *) &pf, fid, RT_FONT, serverClient, + err = dixLookupResourceByType((void **) &pf, fid, RT_FONT, serverClient, DixReadAccess); if (err == Success) last_pf = pf; if (last_pf == (FontPtr) NULL) @@ -199,7 +199,7 @@ RemoveFontWakeup(FontPathElementPtr fpe) } void -FontWakeup(pointer data, int count, pointer LastSelectMask) +FontWakeup(void *data, int count, void *LastSelectMask) { int i; FontPathElementPtr fpe; @@ -226,7 +226,7 @@ FreeFPE(FontPathElementPtr fpe) fpe->refcount--; if (fpe->refcount == 0) { (*fpe_functions[fpe->type].free_fpe) (fpe); - free(fpe->name); + free((void *) fpe->name); free(fpe); } } @@ -272,7 +272,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (client->clientGone) { if (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -280,7 +280,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) while (c->current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current_fpe]; err = (*fpe_functions[fpe->type].open_font) - ((pointer) client, fpe, c->flags, + ((void *) client, fpe, c->flags, c->fontname, c->fnamelen, FontFormat, BitmapFormatMaskByte | BitmapFormatMaskBit | @@ -293,7 +293,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (err == FontNameAlias && alias) { newlen = strlen(alias); - newname = (char *) realloc(c->fontname, newlen); + newname = (char *) realloc((char *) c->fontname, newlen); if (!newname) { err = AllocError; break; @@ -355,7 +355,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) } } } - if (!AddResource(c->fontid, RT_FONT, (pointer) pfont)) { + if (!AddResource(c->fontid, RT_FONT, (void *) pfont)) { err = AllocError; goto bail; } @@ -375,7 +375,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) FreeFPE(c->fpe_list[i]); } free(c->fpe_list); - free(c->fontname); + free((void *) c->fontname); free(c); } return TRUE; @@ -383,7 +383,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c) int OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, - char *pfontname) + const char *pfontname) { OFclosurePtr c; int i; @@ -412,7 +412,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, cached = FindCachedFontPattern(patternCache, pfontname, lenfname); if (cached && cached->info.cachable) { - if (!AddResource(fid, RT_FONT, (pointer) cached)) + if (!AddResource(fid, RT_FONT, (void *) cached)) return BadAlloc; cached->refcnt++; return Success; @@ -434,7 +434,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, */ c->fpe_list = malloc(sizeof(FontPathElementPtr) * num_fpes); if (!c->fpe_list) { - free(c->fontname); + free((void *) c->fontname); free(c); return BadAlloc; } @@ -462,7 +462,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, * \param value must conform to DeleteType */ int -CloseFont(pointer value, XID fid) +CloseFont(void *value, XID fid) { int nscr; ScreenPtr pscr; @@ -584,7 +584,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (client->clientGone) { if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -601,7 +601,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) /* This FPE doesn't support/require list_fonts_and_aliases */ err = (*fpe_functions[fpe->type].list_fonts) - ((pointer) c->client, fpe, c->current.pattern, + ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, c->names); @@ -628,7 +628,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (!c->current.list_started) { err = (*fpe_functions[fpe->type].start_list_fonts_and_aliases) - ((pointer) c->client, fpe, c->current.pattern, + ((void *) c->client, fpe, c->current.pattern, c->current.patlen, c->current.max_names - c->names->nnames, &c->current.private); if (err == Suspended) { @@ -648,7 +648,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) name = 0; err = (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &name, &namelen, &tmpname, + ((void *) c->client, fpe, &name, &namelen, &tmpname, &resolvedlen, c->current.private); if (err == Suspended) { if (!ClientIsAsleep(client)) @@ -700,7 +700,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) tmpname = 0; (void) (*fpe_functions[fpe->type].list_next_font_or_alias) - ((pointer) c->client, fpe, &tmpname, &tmpnamelen, + ((void *) c->client, fpe, &tmpname, &tmpnamelen, &tmpname, &tmpnamelen, c->current.private); if (--aliascount <= 0) { err = BadFontName; @@ -889,7 +889,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (client->clientGone) { if (c->current.current_fpe < c->num_fpes) { fpe = c->fpe_list[c->current.current_fpe]; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } err = Successful; goto bail; @@ -1145,12 +1145,12 @@ doPolyText(ClientPtr client, PTclosurePtr c) if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); if (ClientIsAsleep(client)) { /* Client has died, but we cannot bail out right now. We need to clean up after the work we did when going to - sleep. Setting the drawable pointer to 0 makes this + sleep. Setting the drawable poiner to 0 makes this happen without any attempts to render or perform other unnecessary activities. */ c->pDraw = (DrawablePtr) 0; @@ -1171,7 +1171,7 @@ doPolyText(ClientPtr client, PTclosurePtr c) the FPE code to clean up after client and avoid further rendering while we clean up after ourself. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); c->pDraw = (DrawablePtr) 0; } } @@ -1192,7 +1192,7 @@ doPolyText(ClientPtr client, PTclosurePtr c) fid = ((Font) *(c->pElt + 4)) /* big-endian */ |((Font) *(c->pElt + 3)) << 8 | ((Font) *(c->pElt + 2)) << 16 | ((Font) *(c->pElt + 1)) << 24; - err = dixLookupResourceByType((pointer *) &pFont, fid, RT_FONT, + err = dixLookupResourceByType((void **) &pFont, fid, RT_FONT, client, DixUseAccess); if (err != Success) { /* restore pFont for step 4 (described below) */ @@ -1433,7 +1433,7 @@ doImageText(ClientPtr client, ITclosurePtr c) if (client->clientGone) { fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1447,7 +1447,7 @@ doImageText(ClientPtr client, ITclosurePtr c) /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client. */ fpe = c->pGC->font->fpe; - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); err = Success; goto bail; } @@ -1574,7 +1574,7 @@ ImageText(ClientPtr client, DrawablePtr pDraw, GC * pGC, int nChars, /* does the necessary magic to figure out the fpe type */ static int -DetermineFPEType(char *pathname) +DetermineFPEType(const char *pathname) { int i; @@ -1670,21 +1670,23 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) } /* if error or can't do it, act like it's a new one */ if (!fpe) { + char *name; fpe = malloc(sizeof(FontPathElementRec)); if (!fpe) { err = BadAlloc; goto bail; } - fpe->name = malloc(len + 1); - if (!fpe->name) { + name = malloc(len + 1); + if (!name) { free(fpe); err = BadAlloc; goto bail; } fpe->refcount = 1; - strncpy(fpe->name, (char *) cp, (int) len); - fpe->name[len] = '\0'; + strncpy(name, (char *) cp, (int) len); + name[len] = '\0'; + fpe->name = name; fpe->name_length = len; fpe->type = DetermineFPEType(fpe->name); if (fpe->type == -1) @@ -1697,7 +1699,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) ("[dix] Could not init font path element %s, removing from list!\n", fpe->name); } - free(fpe->name); + free((void *) fpe->name); free(fpe); } } @@ -1749,9 +1751,10 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths) } int -SetDefaultFontPath(char *path) +SetDefaultFontPath(const char *path) { - char *temp_path, *start, *end; + const char *start, *end; + char *temp_path; unsigned char *cp, *pp, *nump, *newpath; int num = 1, len, err, size = 0, bad; @@ -1853,7 +1856,7 @@ DeleteClientFontStuff(ClientPtr client) for (i = 0; i < num_fpes; i++) { fpe = font_path_elements[i]; if (fpe_functions[fpe->type].client_died) - (*fpe_functions[fpe->type].client_died) ((pointer) client, fpe); + (*fpe_functions[fpe->type].client_died) ((void *) client, fpe); } } @@ -1971,7 +1974,7 @@ FreeFonts(void) FontPtr find_old_font(XID id) { - pointer pFont; + void *pFont; dixLookupResourceByType(&pFont, id, RT_NONE, serverClient, DixReadAccess); return (FontPtr) pFont; @@ -1988,7 +1991,7 @@ _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id) { - return AddResource(id, RT_NONE, (pointer) pfont); + return AddResource(id, RT_NONE, (void *) pfont); } _X_EXPORT @@ -2019,7 +2022,7 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) } if (fs_handlers_installed == 0) { if (!RegisterBlockAndWakeupHandlers(block_handler, - FontWakeup, (pointer) 0)) + FontWakeup, (void *) 0)) return AllocError; fs_handlers_installed++; } @@ -2036,7 +2039,7 @@ remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, /* remove the handlers if no one else is using them */ if (--fs_handlers_installed == 0) { RemoveBlockAndWakeupHandlers(block_handler, FontWakeup, - (pointer) 0); + (void *) 0); } } RemoveFontWakeup(fpe); diff --git a/xorg-server/dix/dixutils.c b/xorg-server/dix/dixutils.c index c250bb1db..5de74c8b4 100644 --- a/xorg-server/dix/dixutils.c +++ b/xorg-server/dix/dixutils.c @@ -199,7 +199,7 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client, *pDraw = NULL; - rc = dixLookupResourceByClass((pointer *) &pTmp, id, RC_DRAWABLE, client, + rc = dixLookupResourceByClass((void **) &pTmp, id, RC_DRAWABLE, client, access); if (rc != Success) @@ -236,7 +236,7 @@ dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access) int dixLookupGC(GCPtr *pGC, XID id, ClientPtr client, Mask access) { - return dixLookupResourceByType((pointer *) pGC, id, RT_GC, client, access); + return dixLookupResourceByType((void **) pGC, id, RT_GC, client, access); } int @@ -246,11 +246,11 @@ dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access) GC *pGC; client->errorValue = id; /* EITHER font or gc */ - rc = dixLookupResourceByType((pointer *) pFont, id, RT_FONT, client, + rc = dixLookupResourceByType((void **) pFont, id, RT_FONT, client, access); if (rc != BadFont) return rc; - rc = dixLookupResourceByType((pointer *) &pGC, id, RT_GC, client, access); + rc = dixLookupResourceByType((void **) &pGC, id, RT_GC, client, access); if (rc == BadGC) return BadFont; if (rc == Success) @@ -261,7 +261,7 @@ dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access) int dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access) { - pointer pRes; + void *pRes; int rc = BadValue, clientIndex = CLIENT_ID(rid); if (!clientIndex || !clients[clientIndex] || (rid & SERVER_BIT)) @@ -296,7 +296,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, j = 0; if (numnow) { pTmp = client->saveSet; - while ((j < numnow) && (SaveSetWindow(pTmp[j]) != (pointer) pWin)) + while ((j < numnow) && (SaveSetWindow(pTmp[j]) != (void *) pWin)) j++; } if (mode == SetModeInsert) { @@ -362,7 +362,7 @@ NoopDDA(void) typedef struct _BlockHandler { BlockHandlerProcPtr BlockHandler; WakeupHandlerProcPtr WakeupHandler; - pointer blockData; + void *blockData; Bool deleted; } BlockHandlerRec, *BlockHandlerPtr; @@ -378,7 +378,7 @@ static Bool handlerDeleted; * \param pReadMask nor how it represents the det of descriptors */ void -BlockHandler(pointer pTimeout, pointer pReadmask) +BlockHandler(void *pTimeout, void *pReadmask) { int i, j; @@ -413,7 +413,7 @@ BlockHandler(pointer pTimeout, pointer pReadmask) * \param pReadmask the resulting descriptor mask */ void -WakeupHandler(int result, pointer pReadmask) +WakeupHandler(int result, void *pReadmask) { int i, j; @@ -449,7 +449,7 @@ WakeupHandler(int result, pointer pReadmask) Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, WakeupHandlerProcPtr wakeupHandler, - pointer blockData) + void *blockData) { BlockHandlerPtr new; @@ -472,7 +472,7 @@ RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, WakeupHandlerProcPtr wakeupHandler, - pointer blockData) + void *blockData) { int i; @@ -556,9 +556,8 @@ ProcessWorkQueueZombies(void) } Bool -QueueWorkProc(Bool (*function) - (ClientPtr /* pClient */ , pointer /* closure */ ), - ClientPtr client, pointer closure) +QueueWorkProc(Bool (*function) (ClientPtr pClient, void *closure), + ClientPtr client, void *closure) { WorkQueuePtr q; @@ -586,13 +585,13 @@ typedef struct _SleepQueue { struct _SleepQueue *next; ClientPtr client; ClientSleepProcPtr function; - pointer closure; + void *closure; } SleepQueueRec, *SleepQueuePtr; static SleepQueuePtr sleepQueue = NULL; Bool -ClientSleep(ClientPtr client, ClientSleepProcPtr function, pointer closure) +ClientSleep(ClientPtr client, ClientSleepProcPtr function, void *closure) { SleepQueuePtr q; @@ -666,7 +665,7 @@ static int numCallbackListsToCleanup = 0; static CallbackListPtr **listsToCleanup = NULL; static Bool -_AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) +_AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data) { CallbackPtr cbr; @@ -682,7 +681,7 @@ _AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) } static Bool -_DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) +_DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; @@ -709,7 +708,7 @@ _DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) } void -_CallCallbacks(CallbackListPtr *pcbl, pointer call_data) +_CallCallbacks(CallbackListPtr *pcbl, void *call_data) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; @@ -821,7 +820,7 @@ CreateCallbackList(CallbackListPtr *pcbl) /* ===== Public Procedures ===== */ Bool -AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) +AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data) { if (!pcbl) return FALSE; @@ -833,7 +832,7 @@ AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) } Bool -DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) +DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, void *data) { if (!pcbl || !*pcbl) return FALSE; diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index 291eec5ed..3c3febdc5 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -580,7 +580,7 @@ XineramaSetWindowPntrs(DeviceIntPtr pDev, WindowPtr pWin) PanoramiXRes *win; int rc, i; - rc = dixLookupResourceByType((pointer *) &win, pWin->drawable.id, + rc = dixLookupResourceByType((void **) &win, pWin->drawable.id, XRT_WINDOW, serverClient, DixReadAccess); if (rc != Success) return FALSE; @@ -1165,7 +1165,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) eventinfo.event = ev; eventinfo.device = device; - CallCallbacks(&DeviceEventCallback, (pointer) &eventinfo); + CallCallbacks(&DeviceEventCallback, (void *) &eventinfo); } if (event->type == ET_Motion) { @@ -2674,6 +2674,9 @@ DeliverOneEvent(InternalEvent *event, DeviceIntPtr dev, enum InputLevel level, case CORE: rc = EventToCore(event, &xE, &count); break; + default: + rc = BadImplementation; + break; } if (rc == Success) { @@ -3832,6 +3835,8 @@ MatchForType(const GrabPtr grab, GrabPtr tmp, enum InputLevel level, match = CORE_MATCH; ignore_device = TRUE; break; + default: + return NO_MATCH; } tmp->grabtype = grabtype; @@ -4416,7 +4421,7 @@ RecalculateDeliverableEvents(WindowPtr pWin) * \param value must conform to DeleteType */ int -OtherClientGone(pointer value, XID id) +OtherClientGone(void *value, XID id) { OtherClientsPtr other, prev; WindowPtr pWin = (WindowPtr) value; @@ -4498,7 +4503,7 @@ EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask) others->resource = FakeClientID(client->index); others->next = pWin->optional->otherClients; pWin->optional->otherClients = others; - if (!AddResource(others->resource, RT_OTHERCLIENT, (pointer) pWin)) + if (!AddResource(others->resource, RT_OTHERCLIENT, (void *) pWin)) return BadAlloc; } maskSet: @@ -4985,7 +4990,7 @@ ProcChangeActivePointerGrab(ClientPtr client) if (stuff->cursor == None) newCursor = NullCursor; else { - int rc = dixLookupResourceByType((pointer *) &newCursor, stuff->cursor, + int rc = dixLookupResourceByType((void **) &newCursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { @@ -5102,7 +5107,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev, if (curs == None) cursor = NullCursor; else { - rc = dixLookupResourceByType((pointer *) &cursor, curs, RT_CURSOR, + rc = dixLookupResourceByType((void **) &cursor, curs, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = curs; @@ -5627,7 +5632,7 @@ ProcGrabButton(ClientPtr client) if (stuff->cursor == None) cursor = NullCursor; else { - rc = dixLookupResourceByType((pointer *) &cursor, stuff->cursor, + rc = dixLookupResourceByType((void **) &cursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) { client->errorValue = stuff->cursor; @@ -5880,7 +5885,7 @@ ProcRecolorCursor(ClientPtr client) REQUEST(xRecolorCursorReq); REQUEST_SIZE_MATCH(xRecolorCursorReq); - rc = dixLookupResourceByType((pointer *) &pCursor, stuff->cursor, RT_CURSOR, + rc = dixLookupResourceByType((void **) &pCursor, stuff->cursor, RT_CURSOR, client, DixWriteAccess); if (rc != Success) { client->errorValue = stuff->cursor; @@ -5981,7 +5986,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) eventinfo.client = pClient; eventinfo.events = events; eventinfo.count = count; - CallCallbacks(&EventCallback, (pointer) &eventinfo); + CallCallbacks(&EventCallback, (void *) &eventinfo); } #ifdef XSERVER_DTRACE if (XSERVER_SEND_EVENT_ENABLED()) { diff --git a/xorg-server/dix/extension.c b/xorg-server/dix/extension.c index bdbbf014c..8240c42d9 100644 --- a/xorg-server/dix/extension.c +++ b/xorg-server/dix/extension.c @@ -96,7 +96,7 @@ AddExtension(const char *name, int NumEvents, int NumErrors, } ext->name = strdup(name); ext->num_aliases = 0; - ext->aliases = (char **) NULL; + ext->aliases = (const char **) NULL; if (!ext->name) { dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION); free(ext); @@ -106,7 +106,7 @@ AddExtension(const char *name, int NumEvents, int NumErrors, newexts = (ExtensionEntry **) realloc(extensions, (i + 1) * sizeof(ExtensionEntry *)); if (!newexts) { - free(ext->name); + free((void *) ext->name); dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION); free(ext); return ((ExtensionEntry *) NULL); @@ -147,12 +147,12 @@ Bool AddExtensionAlias(const char *alias, ExtensionEntry * ext) { char *name; - char **aliases; + const char **aliases; if (!ext) return FALSE; - aliases = (char **) realloc(ext->aliases, - (ext->num_aliases + 1) * sizeof(char *)); + aliases = realloc(ext->aliases, + (ext->num_aliases + 1) * sizeof(char *)); if (!aliases) return FALSE; ext->aliases = aliases; @@ -229,9 +229,9 @@ CloseDownExtensions(void) if (extensions[i]->CloseDown) extensions[i]->CloseDown(extensions[i]); NumExtensions = i; - free(extensions[i]->name); + free((void *) extensions[i]->name); for (j = extensions[i]->num_aliases; --j >= 0;) - free(extensions[i]->aliases[j]); + free((void *) extensions[i]->aliases[j]); free(extensions[i]->aliases); dixFreePrivates(extensions[i]->devPrivates, PRIVATE_EXTENSION); free(extensions[i]); diff --git a/xorg-server/dix/gc.c b/xorg-server/dix/gc.c index 57190d11f..1fb577e53 100644 --- a/xorg-server/dix/gc.c +++ b/xorg-server/dix/gc.c @@ -357,7 +357,7 @@ ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion) pPixmap->refcnt++; } (*pGC->funcs->ChangeClip) (pGC, pPixmap ? CT_PIXMAP : CT_NONE, - (pointer) pPixmap, 0); + (void *) pPixmap, 0); break; case GCDashOffset: NEXTVAL(INT16, pGC->dashOffset); @@ -512,7 +512,7 @@ NewGCObject(ScreenPtr pScreen, int depth) pGC->clipOrg.x = 0; pGC->clipOrg.y = 0; pGC->clientClipType = CT_NONE; - pGC->clientClip = (pointer) NULL; + pGC->clientClip = (void *) NULL; pGC->numInDashList = 2; pGC->dash = DefaultDash; pGC->dashOffset = 0; @@ -782,7 +782,7 @@ CopyGC(GC * pgcSrc, GC * pgcDst, BITS32 mask) * \param value must conform to DeleteType */ int -FreeGC(pointer value, XID gid) +FreeGC(void *value, XID gid) { GCPtr pGC = (GCPtr) value; @@ -1041,7 +1041,7 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects, if (size) memmove((char *) prectsNew, (char *) prects, size); - (*pGC->funcs->ChangeClip) (pGC, newct, (pointer) prectsNew, nrects); + (*pGC->funcs->ChangeClip) (pGC, newct, (void *) prectsNew, nrects); if (pGC->funcs->ChangeGC) (*pGC->funcs->ChangeGC) (pGC, GCClipXOrigin | GCClipYOrigin | GCClipMask); diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index 3b87e17d4..5a0296ba5 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -1398,10 +1398,10 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, { int num_events = 1; DeviceEvent *event; - RawDeviceEvent *raw; + RawDeviceEvent *raw = NULL; double screenx = 0.0, screeny = 0.0; /* desktop coordinate system */ double devx = 0.0, devy = 0.0; /* desktop-wide in device coords */ - int sx, sy; /* for POINTER_SCREEN */ + int sx = 0, sy = 0; /* for POINTER_SCREEN */ ValuatorMask mask; ScreenPtr scr; int num_barrier_events = 0; @@ -1453,7 +1453,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, transformAbsolute(pDev, &mask); clipAbsolute(pDev, &mask); - if ((flags & POINTER_NORAW) == 0) + if ((flags & POINTER_NORAW) == 0 && raw) set_raw_valuators(raw, &mask, raw->valuators.data); } else { @@ -1461,7 +1461,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, if (flags & POINTER_ACCELERATE) accelPointer(pDev, &mask, ms); - if ((flags & POINTER_NORAW) == 0) + if ((flags & POINTER_NORAW) == 0 && raw) set_raw_valuators(raw, &mask, raw->valuators.data); moveRelative(pDev, flags, &mask); @@ -1528,7 +1528,8 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, event_set_root_coordinates(event, screenx - scr->x, screeny - scr->y); if (flags & POINTER_EMULATED) { - raw->flags = XIPointerEmulated; + if (raw) + raw->flags = XIPointerEmulated; event->flags = XIPointerEmulated; } diff --git a/xorg-server/dix/globals.c b/xorg-server/dix/globals.c index ad9145b01..9738e9cdf 100644 --- a/xorg-server/dix/globals.c +++ b/xorg-server/dix/globals.c @@ -112,9 +112,9 @@ int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES; Bool screenSaverSuspended = FALSE; #endif -char *defaultFontPath = COMPILEDDEFAULTFONTPATH; -char *defaultTextFont = COMPILEDDEFAULTFONT; -char *defaultCursorFont = COMPILEDCURSORFONT; +const char *defaultFontPath = COMPILEDDEFAULTFONTPATH; +const char *defaultTextFont = COMPILEDDEFAULTFONT; +const char *defaultCursorFont = COMPILEDCURSORFONT; FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in every compilation of dix code */ CursorPtr rootCursor; @@ -126,7 +126,7 @@ TimeStamp currentTime; int defaultColorVisualClass = -1; int monitorResolution = 0; -char *display; +const char *display; int displayfd; char *ConnectionInfo; diff --git a/xorg-server/dix/glyphcurs.c b/xorg-server/dix/glyphcurs.c index 9004cb152..54040253c 100644 --- a/xorg-server/dix/glyphcurs.c +++ b/xorg-server/dix/glyphcurs.c @@ -114,7 +114,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, /* fill the pixmap with 0 */ gcval[0].val = GXcopy; gcval[1].val = 0; - gcval[2].ptr = (pointer) pfont; + gcval[2].ptr = (void *) pfont; ChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont, gcval); ValidateGC((DrawablePtr) ppix, pGC); (*pGC->ops->PolyFillRect) ((DrawablePtr) ppix, pGC, 1, &rect); diff --git a/xorg-server/dix/grabs.c b/xorg-server/dix/grabs.c index a03897af4..5fd68202a 100644 --- a/xorg-server/dix/grabs.c +++ b/xorg-server/dix/grabs.c @@ -317,7 +317,7 @@ CopyGrab(GrabPtr dst, const GrabPtr src) } int -DeletePassiveGrab(pointer value, XID id) +DeletePassiveGrab(void *value, XID id) { GrabPtr g, prev; GrabPtr pGrab = (GrabPtr) value; @@ -564,7 +564,7 @@ AddPassiveGrabToList(ClientPtr client, GrabPtr pGrab) pGrab->next = pGrab->window->optional->passiveGrabs; pGrab->window->optional->passiveGrabs = pGrab; - if (AddResource(pGrab->resource, RT_PASSIVEGRAB, (pointer) pGrab)) + if (AddResource(pGrab->resource, RT_PASSIVEGRAB, (void *) pGrab)) return Success; return BadAlloc; } @@ -662,7 +662,7 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) ok = FALSE; } else if (!AddResource(pNewGrab->resource, RT_PASSIVEGRAB, - (pointer) pNewGrab)) + (void *) pNewGrab)) ok = FALSE; else adds[nadds++] = pNewGrab; diff --git a/xorg-server/dix/inpututils.c b/xorg-server/dix/inpututils.c index 3098cdb0b..1ab16d14b 100644 --- a/xorg-server/dix/inpututils.c +++ b/xorg-server/dix/inpututils.c @@ -351,7 +351,7 @@ DuplicateInputAttributes(InputAttributes * attrs) { InputAttributes *new_attr; int ntags = 0; - char **tags, **new_tags; + const char **tags, **new_tags; if (!attrs) return NULL; @@ -403,20 +403,20 @@ DuplicateInputAttributes(InputAttributes * attrs) void FreeInputAttributes(InputAttributes * attrs) { - char **tags; + const char **tags; if (!attrs) return; - free(attrs->product); - free(attrs->vendor); - free(attrs->device); - free(attrs->pnp_id); - free(attrs->usb_id); + free((void *) attrs->product); + free((void *) attrs->vendor); + free((void *) attrs->device); + free((void *) attrs->pnp_id); + free((void *) attrs->usb_id); if ((tags = attrs->tags)) while (*tags) - free(*tags++); + free((void *) *tags++); free(attrs->tags); free(attrs); diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c index 374ec2cf7..5f499741c 100644 --- a/xorg-server/dix/main.c +++ b/xorg-server/dix/main.c @@ -212,7 +212,7 @@ dix_main(int argc, char *argv[], char *envp[]) serverClient = calloc(sizeof(ClientRec), 1); if (!serverClient) FatalError("couldn't create server client"); - InitClient(serverClient, 0, (pointer) NULL); + InitClient(serverClient, 0, (void *) NULL); } else ResetWellKnownSockets(); diff --git a/xorg-server/dix/pixmap.c b/xorg-server/dix/pixmap.c index d5dc3831b..4b880af58 100644 --- a/xorg-server/dix/pixmap.c +++ b/xorg-server/dix/pixmap.c @@ -49,7 +49,7 @@ from The Open Group. /* callable by ddx */ PixmapPtr GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) + int bitsPerPixel, int devKind, void *pPixData) { PixmapPtr pPixmap = pScreen->pScratchPixmap; diff --git a/xorg-server/dix/privates.c b/xorg-server/dix/privates.c index f9b45d816..ffa07fede 100644 --- a/xorg-server/dix/privates.c +++ b/xorg-server/dix/privates.c @@ -268,7 +268,7 @@ fixupDefaultColormaps(FixupFunc fixup, unsigned bytes) for (s = 0; s < screenInfo.numScreens; s++) { ColormapPtr cmap; - dixLookupResourceByType((pointer *) &cmap, + dixLookupResourceByType((void **) &cmap, screenInfo.screens[s]->defColormap, RT_COLORMAP, serverClient, DixCreateAccess); if (cmap && @@ -370,7 +370,7 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size) if (size == 0) bytes = sizeof(void *); - /* align to void * size */ + /* align to pointer size */ bytes = (bytes + sizeof(void *) - 1) & ~(sizeof(void *) - 1); /* Update offsets for all affected keys */ @@ -719,7 +719,7 @@ _dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen, privates_size = pScreen->screenSpecificPrivates[type].offset; else privates_size = global_keys[type].offset; - /* round up so that void * is aligned */ + /* round up so that pointer is aligned */ baseSize = (baseSize + sizeof(void *) - 1) & ~(sizeof(void *) - 1); totalSize = baseSize + privates_size; object = malloc(totalSize); diff --git a/xorg-server/dix/property.c b/xorg-server/dix/property.c index 833c3ca59..b40e6f0c1 100644 --- a/xorg-server/dix/property.c +++ b/xorg-server/dix/property.c @@ -242,7 +242,7 @@ ProcChangeProperty(ClientPtr client) int dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent) + void *value, Bool sendevent) { PropertyPtr pProp; PropertyRec savedProp; @@ -356,7 +356,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, int ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, pointer value, Bool sendevent) + int mode, unsigned long len, void *value, Bool sendevent) { return dixChangeWindowProperty(serverClient, pWin, property, type, format, mode, len, value, sendevent); diff --git a/xorg-server/dix/resource.c b/xorg-server/dix/resource.c index c04b5578e..a3f5fc845 100644 --- a/xorg-server/dix/resource.c +++ b/xorg-server/dix/resource.c @@ -165,7 +165,7 @@ typedef struct _Resource { struct _Resource *next; XID id; RESTYPE type; - pointer value; + void *value; } ResourceRec, *ResourcePtr; typedef struct _ClientResource { @@ -203,7 +203,7 @@ struct ResourceType { * resource can't be determined. */ static void -GetDefaultBytes(pointer value, XID id, ResourceSizePtr size) +GetDefaultBytes(void *value, XID id, ResourceSizePtr size) { size->resourceSize = 0; size->pixmapRefSize = 0; @@ -224,7 +224,7 @@ GetDefaultBytes(pointer value, XID id, ResourceSizePtr size) * @param[out] cdata Pointer to opaque data. */ static void -DefaultFindSubRes(pointer value, FindAllRes func, pointer cdata) +DefaultFindSubRes(void *value, FindAllRes func, void *cdata) { /* do nothing */ } @@ -268,7 +268,7 @@ GetDrawableBytes(DrawablePtr drawable) * pixmap reference. */ static void -GetPixmapBytes(pointer value, XID id, ResourceSizePtr size) +GetPixmapBytes(void *value, XID id, ResourceSizePtr size) { PixmapPtr pixmap = value; @@ -297,7 +297,7 @@ GetPixmapBytes(pointer value, XID id, ResourceSizePtr size) * pixmap references of a window. */ static void -GetWindowBytes(pointer value, XID id, ResourceSizePtr size) +GetWindowBytes(void *value, XID id, ResourceSizePtr size) { SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); ResourceSizeRec pixmapSize = { 0, 0, 0 }; @@ -339,7 +339,7 @@ GetWindowBytes(pointer value, XID id, ResourceSizePtr size) * @param[out] cdata Pointer to opaque data */ static void -FindWindowSubRes(pointer value, FindAllRes func, pointer cdata) +FindWindowSubRes(void *value, FindAllRes func, void *cdata) { WindowPtr window = value; @@ -370,7 +370,7 @@ FindWindowSubRes(pointer value, FindAllRes func, pointer cdata) * pixmap references of a graphics context. */ static void -GetGcBytes(pointer value, XID id, ResourceSizePtr size) +GetGcBytes(void *value, XID id, ResourceSizePtr size) { SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); ResourceSizeRec pixmapSize = { 0, 0, 0 }; @@ -411,7 +411,7 @@ GetGcBytes(pointer value, XID id, ResourceSizePtr size) * @param[out] cdata Pointer to opaque data */ static void -FindGCSubRes(pointer value, FindAllRes func, pointer cdata) +FindGCSubRes(void *value, FindAllRes func, void *cdata) { GCPtr gc = value; @@ -743,7 +743,7 @@ GetXIDList(ClientPtr pClient, unsigned count, XID *pids) unsigned int found = 0; XID rc, id = pClient->clientAsMask; XID maxid; - pointer val; + void *val; maxid = id | RESOURCE_ID_MASK; while ((found < count) && (id <= maxid)) { @@ -787,7 +787,7 @@ FakeClientID(int client) } Bool -AddResource(XID id, RESTYPE type, pointer value) +AddResource(XID id, RESTYPE type, void *value) { int client; ClientResourceRec *rrec; @@ -948,7 +948,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) */ Bool -ChangeResourceValue(XID id, RESTYPE rtype, pointer value) +ChangeResourceValue(XID id, RESTYPE rtype, void *value) { int cid; ResourcePtr res; @@ -973,7 +973,7 @@ ChangeResourceValue(XID id, RESTYPE rtype, pointer value) void FindClientResourcesByType(ClientPtr client, - RESTYPE type, FindResType func, pointer cdata) + RESTYPE type, FindResType func, void *cdata) { ResourcePtr *resources; ResourcePtr this, next; @@ -998,17 +998,17 @@ FindClientResourcesByType(ClientPtr client, } } -void FindSubResources(pointer resource, +void FindSubResources(void *resource, RESTYPE type, FindAllRes func, - pointer cdata) + void *cdata) { struct ResourceType rtype = resourceTypes[type & TypeMask]; rtype.findSubResFunc(resource, func, cdata); } void -FindAllClientResources(ClientPtr client, FindAllRes func, pointer cdata) +FindAllClientResources(ClientPtr client, FindAllRes func, void *cdata) { ResourcePtr *resources; ResourcePtr this, next; @@ -1031,14 +1031,14 @@ FindAllClientResources(ClientPtr client, FindAllRes func, pointer cdata) } } -pointer +void * LookupClientResourceComplex(ClientPtr client, RESTYPE type, - FindComplexResType func, pointer cdata) + FindComplexResType func, void *cdata) { ResourcePtr *resources; ResourcePtr this, next; - pointer value; + void *value; int i; if (!client) @@ -1158,7 +1158,7 @@ FreeAllResources(void) Bool LegalNewID(XID id, ClientPtr client) { - pointer val; + void *val; int rc; #ifdef PANORAMIX @@ -1181,7 +1181,7 @@ LegalNewID(XID id, ClientPtr client) } int -dixLookupResourceByType(pointer *result, XID id, RESTYPE rtype, +dixLookupResourceByType(void **result, XID id, RESTYPE rtype, ClientPtr client, Mask mode) { int cid = CLIENT_ID(id); @@ -1216,7 +1216,7 @@ dixLookupResourceByType(pointer *result, XID id, RESTYPE rtype, } int -dixLookupResourceByClass(pointer *result, XID id, RESTYPE rclass, +dixLookupResourceByClass(void **result, XID id, RESTYPE rclass, ClientPtr client, Mask mode) { int cid = CLIENT_ID(id); diff --git a/xorg-server/dix/touch.c b/xorg-server/dix/touch.c index a7ea213ba..1eeed78bd 100644 --- a/xorg-server/dix/touch.c +++ b/xorg-server/dix/touch.c @@ -75,7 +75,7 @@ static unsigned char resize_waiting[(MAXDEVICES + 7) / 8]; * anyway and re-executing this won't help. */ static Bool -TouchResizeQueue(ClientPtr client, pointer closure) +TouchResizeQueue(ClientPtr client, void *closure) { int i; diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index 4a455c9c7..7bbfc719b 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -227,7 +227,7 @@ log_window_info(WindowPtr pWin, int depth) win_name = get_window_name(pWin); ErrorF("win 0x%.8x (%s), [%d, %d] to [%d, %d]", - pWin->drawable.id, + (unsigned) pWin->drawable.id, win_name ? win_name : "no name", pWin->drawable.x, pWin->drawable.y, pWin->drawable.x + pWin->drawable.width, @@ -240,7 +240,7 @@ log_window_info(WindowPtr pWin, int depth) ErrorF(" (%s compositing: pixmap %x)", (pWin->redirectDraw == RedirectDrawAutomatic) ? "automatic" : "manual", - pScreen->GetWindowPixmap(pWin)->drawable.id); + (unsigned) pScreen->GetWindowPixmap(pWin)->drawable.id); #endif switch (pWin->visibility) { @@ -283,7 +283,7 @@ PrintWindowTree(void) for (scrnum = 0; scrnum < screenInfo.numScreens; scrnum++) { pScreen = screenInfo.screens[scrnum]; ErrorF("[dix] Dumping windows for screen %d (pixmap %x):\n", scrnum, - pScreen->GetScreenPixmap(pScreen)->drawable.id); + (unsigned) pScreen->GetScreenPixmap(pScreen)->drawable.id); pWin = pScreen->root; depth = 1; while (pWin) { @@ -305,7 +305,7 @@ PrintWindowTree(void) } int -TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data) +TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, void *data) { int result; WindowPtr pChild; @@ -338,7 +338,7 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data) *****/ int -WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, pointer data) +WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, void *data) { return (TraverseTree(pScreen->root, func, data)); } @@ -363,7 +363,7 @@ SetWindowToDefaults(WindowPtr pWin) pWin->backingStore = NotUseful; pWin->DIXsaveUnder = FALSE; - pWin->backStorage = (pointer) NULL; + pWin->backStorage = (void *) NULL; pWin->mapped = FALSE; /* off */ pWin->realized = FALSE; /* off */ @@ -524,7 +524,7 @@ CreateRootWindow(ScreenPtr pScreen) RT_WINDOW, pWin, RT_NONE, NULL, DixCreateAccess)) return FALSE; - if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer) pWin)) + if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *) pWin)) return FALSE; if (disableBackingStore) @@ -961,7 +961,7 @@ CrushTree(WindowPtr pWin) *****/ int -DeleteWindow(pointer value, XID wid) +DeleteWindow(void *value, XID wid) { WindowPtr pParent; WindowPtr pWin = (WindowPtr) value; @@ -1111,7 +1111,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) * incremented. */ } else { - rc = dixLookupResourceByType((pointer *) &pPixmap, pixID, + rc = dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (rc == Success) { if ((pPixmap->drawable.depth != pWin->drawable.depth) || @@ -1165,7 +1165,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) pixID = pWin->parent->border.pixmap->drawable.id; } } - rc = dixLookupResourceByType((pointer *) &pPixmap, pixID, RT_PIXMAP, + rc = dixLookupResourceByType((void **) &pPixmap, pixID, RT_PIXMAP, client, DixReadAccess); if (rc == Success) { if ((pPixmap->drawable.depth != pWin->drawable.depth) || @@ -1312,7 +1312,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) error = BadMatch; goto PatchUp; } - rc = dixLookupResourceByType((pointer *) &pCmap, cmap, RT_COLORMAP, + rc = dixLookupResourceByType((void **) &pCmap, cmap, RT_COLORMAP, client, DixUseAccess); if (rc != Success) { error = rc; @@ -1382,7 +1382,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) pCursor = (CursorPtr) None; } else { - rc = dixLookupResourceByType((pointer *) &pCursor, cursorID, + rc = dixLookupResourceByType((void **) &pCursor, cursorID, RT_CURSOR, client, DixUseAccess); if (rc != Success) { error = rc; @@ -2380,7 +2380,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) } static int -CompareWIDs(WindowPtr pWin, pointer value) +CompareWIDs(WindowPtr pWin, void *value) { /* must conform to VisitWindowProcPtr */ Window *wid = (Window *) value; @@ -2405,7 +2405,7 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent, ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; - if (TraverseTree(pWin, CompareWIDs, (pointer) &pParent->drawable.id) == + if (TraverseTree(pWin, CompareWIDs, (void *) &pParent->drawable.id) == WT_STOPWALKING) return BadMatch; if (!MakeWindowOptional(pWin)) @@ -2691,7 +2691,7 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure) #ifdef PANORAMIX if (!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) { PanoramiXRes *win; - int rc = dixLookupResourceByType((pointer *) &win, + int rc = dixLookupResourceByType((void **) &win, pChild->drawable.id, XRT_WINDOW, serverClient, DixWriteAccess); @@ -3170,7 +3170,7 @@ TileScreenSaver(ScreenPtr pScreen, int kind) &cursor, serverClient, (XID) 0); if (cursor) { cursorID = FakeClientID(0); - if (AddResource(cursorID, RT_CURSOR, (pointer) cursor)) { + if (AddResource(cursorID, RT_CURSOR, (void *) cursor)) { attributes[attri] = cursorID; mask |= CWCursor; } @@ -3199,7 +3199,7 @@ TileScreenSaver(ScreenPtr pScreen, int kind) return FALSE; if (!AddResource(pWin->drawable.id, RT_WINDOW, - (pointer) pScreen->screensaver.pWindow)) + (void *) pScreen->screensaver.pWindow)) return FALSE; if (mask & CWBackPixmap) { diff --git a/xorg-server/dri3/dri3_event.c b/xorg-server/dri3/dri3_event.c index 02f0f6579..cb509a26d 100644 --- a/xorg-server/dri3/dri3_event.c +++ b/xorg-server/dri3/dri3_event.c @@ -29,7 +29,7 @@ RESTYPE dri3_event_type; static int -dri3_free_event(pointer data, XID id) +dri3_free_event(void *data, XID id) { dri3_event_ptr dri3_event = (dri3_event_ptr) data; dri3_window_priv_ptr window_priv = dri3_window_priv(dri3_event->window); @@ -41,7 +41,7 @@ dri3_free_event(pointer data, XID id) break; } } - free((pointer) dri3_event); + free((void *) dri3_event); return 1; } @@ -145,7 +145,7 @@ dri3_select_input(ClientPtr client, XID eid, WindowPtr window, CARD32 mask) event->next = window_priv->events; window_priv->events = event; - if (!AddResource(event->id, dri3_event_type, (pointer) event)) + if (!AddResource(event->id, dri3_event_type, (void *) event)) return BadAlloc; return Success; diff --git a/xorg-server/dri3/dri3_request.c b/xorg-server/dri3/dri3_request.c index 4e1408fb5..31dce83f6 100644 --- a/xorg-server/dri3/dri3_request.c +++ b/xorg-server/dri3/dri3_request.c @@ -168,7 +168,7 @@ proc_dri3_pixmap_from_buffer(ClientPtr client) (*drawable->pScreen->DestroyPixmap) (pixmap); return rc; } - if (AddResource(stuff->pixmap, RT_PIXMAP, (pointer) pixmap)) + if (AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) return Success; return Success; @@ -189,7 +189,7 @@ proc_dri3_buffer_from_pixmap(ClientPtr client) PixmapPtr pixmap; REQUEST_SIZE_MATCH(xDRI3BufferFromPixmapReq); - rc = dixLookupResourceByType((pointer *) &pixmap, stuff->pixmap, RT_PIXMAP, + rc = dixLookupResourceByType((void **) &pixmap, stuff->pixmap, RT_PIXMAP, client, DixWriteAccess); if (rc != Success) { client->errorValue = stuff->pixmap; diff --git a/xorg-server/exa/exa.c b/xorg-server/exa/exa.c index f8e499c2b..a2995db24 100644 --- a/xorg-server/exa/exa.c +++ b/xorg-server/exa/exa.c @@ -475,7 +475,7 @@ static void exaCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void - exaChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); + exaChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); static void exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc); @@ -579,7 +579,7 @@ exaCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) } static void -exaChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +exaChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { ExaGCPriv(pGC); swap(pExaGC, pGC, funcs); @@ -620,8 +620,8 @@ exaCreateGC(GCPtr pGC) swap(pExaScr, pScreen, CreateGC); if ((ret = (*pScreen->CreateGC) (pGC))) { - wrap(pExaGC, pGC, funcs, (GCFuncs *) &exaGCFuncs); - wrap(pExaGC, pGC, ops, (GCOps *) &exaOps); + wrap(pExaGC, pGC, funcs, &exaGCFuncs); + wrap(pExaGC, pGC, ops, &exaOps); } swap(pExaScr, pScreen, CreateGC); @@ -702,8 +702,8 @@ exaCreateScreenResources(ScreenPtr pScreen) } static void -ExaBlockHandler(ScreenPtr pScreen, pointer pTimeout, - pointer pReadmask) +ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, + void *pReadmask) { ExaScreenPriv(pScreen); @@ -733,7 +733,7 @@ ExaBlockHandler(ScreenPtr pScreen, pointer pTimeout, static void ExaWakeupHandler(ScreenPtr pScreen, unsigned long result, - pointer pReadmask) + void *pReadmask) { ExaScreenPriv(pScreen); diff --git a/xorg-server/exa/exa.h b/xorg-server/exa/exa.h index be022b2db..98d094dff 100644 --- a/xorg-server/exa/exa.h +++ b/xorg-server/exa/exa.h @@ -58,7 +58,7 @@ struct _ExaOffscreenArea { int offset; /* aligned offset */ int size; /* total allocation size */ unsigned last_use; - pointer privData; + void *privData; ExaOffscreenSaveProc save; @@ -685,7 +685,7 @@ typedef struct _ExaDriver { */ Bool (*ModifyPixmapHeader) (PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, - pointer pPixData); + void *pPixData); /* hooks for drivers with tiling support: * driver MUST fill out new_fb_pitch with valid pitch of pixmap @@ -784,7 +784,7 @@ extern _X_EXPORT ExaOffscreenArea *exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, Bool locked, ExaOffscreenSaveProc save, - pointer privData); + void *privData); extern _X_EXPORT ExaOffscreenArea *exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea * area); diff --git a/xorg-server/exa/exa_classic.c b/xorg-server/exa/exa_classic.c index 0fa422fcd..a6a60e50c 100644 --- a/xorg-server/exa/exa_classic.c +++ b/xorg-server/exa/exa_classic.c @@ -147,7 +147,7 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, Bool exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, - pointer pPixData) + void *pPixData) { ScreenPtr pScreen; ExaScreenPrivPtr pExaScr; diff --git a/xorg-server/exa/exa_driver.c b/xorg-server/exa/exa_driver.c index d467ca928..8799a798e 100644 --- a/xorg-server/exa/exa_driver.c +++ b/xorg-server/exa/exa_driver.c @@ -130,7 +130,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth, Bool exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, - pointer pPixData) + void *pPixData) { ScreenPtr pScreen; ExaScreenPrivPtr pExaScr; @@ -218,7 +218,7 @@ exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap) ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); - pointer saved_ptr; + void *saved_ptr; Bool ret; saved_ptr = pPixmap->devPrivate.ptr; diff --git a/xorg-server/exa/exa_glyphs.c b/xorg-server/exa/exa_glyphs.c index 71f750fb6..aa71b215e 100644 --- a/xorg-server/exa/exa_glyphs.c +++ b/xorg-server/exa/exa_glyphs.c @@ -127,7 +127,7 @@ exaUnrealizeGlyphCaches(ScreenPtr pScreen, unsigned int format) continue; if (cache->picture) { - FreePicture((pointer) cache->picture, (XID) 0); + FreePicture((void *) cache->picture, (XID) 0); cache->picture = NULL; } @@ -225,7 +225,7 @@ exaRealizeGlyphCaches(ScreenPtr pScreen, unsigned int format) } /* Each cache references the picture individually */ - FreePicture((pointer) pPicture, (XID) 0); + FreePicture((void *) pPicture, (XID) 0); return TRUE; bail: @@ -737,7 +737,7 @@ exaGlyphs(CARD8 op, /* The driver can't seem to composite to a8, let's try argb (but * without component-alpha) */ - FreePicture((pointer) pMask, (XID) 0); + FreePicture((void *) pMask, (XID) 0); argbFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8); @@ -833,7 +833,7 @@ exaGlyphs(CARD8 op, pDst, xSrc + x - first_xOff, ySrc + y - first_yOff, 0, 0, x, y, width, height); - FreePicture((pointer) pMask, (XID) 0); + FreePicture((void *) pMask, (XID) 0); (*pScreen->DestroyPixmap) (pMaskPixmap); } } diff --git a/xorg-server/exa/exa_migration_classic.c b/xorg-server/exa/exa_migration_classic.c index 65bbb17ce..89eff6200 100644 --- a/xorg-server/exa/exa_migration_classic.c +++ b/xorg-server/exa/exa_migration_classic.c @@ -350,7 +350,7 @@ exaDoMoveInPixmap(ExaMigrationPtr migrate) pExaPixmap->area = exaOffscreenAlloc(pScreen, pExaPixmap->fb_size, pExaScr->info->pixmapOffsetAlign, FALSE, - exaPixmapSave, (pointer) pPixmap); + exaPixmapSave, (void *) pPixmap); if (pExaPixmap->area == NULL) return; @@ -465,12 +465,12 @@ exaMigrateTowardFb(ExaMigrationPtr migrate) if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) { DBG_MIGRATE(("UseScreen: not migrating pinned pixmap %p\n", - (pointer) pPixmap)); + (void *) pPixmap)); return; } DBG_MIGRATE(("UseScreen %p score %d\n", - (pointer) pPixmap, pExaPixmap->score)); + (void *) pPixmap, pExaPixmap->score)); if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) { exaDoMoveInPixmap(migrate); @@ -504,7 +504,7 @@ exaMigrateTowardSys(ExaMigrationPtr migrate) ExaPixmapPriv(pPixmap); - DBG_MIGRATE(("UseMem: %p score %d\n", (pointer) pPixmap, + DBG_MIGRATE(("UseMem: %p score %d\n", (void *) pPixmap, pExaPixmap->score)); if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED) diff --git a/xorg-server/exa/exa_mixed.c b/xorg-server/exa/exa_mixed.c index b43dfec42..f618a1ea8 100644 --- a/xorg-server/exa/exa_mixed.c +++ b/xorg-server/exa/exa_mixed.c @@ -125,7 +125,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, Bool exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) + int bitsPerPixel, int devKind, void *pPixData) { ScreenPtr pScreen; ExaScreenPrivPtr pExaScr; @@ -282,7 +282,7 @@ exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap) ExaScreenPriv(pScreen); ExaPixmapPriv(pPixmap); - pointer saved_ptr; + void *saved_ptr; Bool ret; if (!pExaPixmap->driverPriv) diff --git a/xorg-server/exa/exa_offscreen.c b/xorg-server/exa/exa_offscreen.c index 1f571cf22..e28734898 100644 --- a/xorg-server/exa/exa_offscreen.c +++ b/xorg-server/exa/exa_offscreen.c @@ -160,7 +160,7 @@ exaFindAreaToEvict(ExaScreenPrivPtr pExaScr, int size, int align) */ ExaOffscreenArea * exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, - Bool locked, ExaOffscreenSaveProc save, pointer privData) + Bool locked, ExaOffscreenSaveProc save, void *privData) { ExaOffscreenArea *area; diff --git a/xorg-server/exa/exa_priv.h b/xorg-server/exa/exa_priv.h index 1f5605687..61a1f4ccb 100644 --- a/xorg-server/exa/exa_priv.h +++ b/xorg-server/exa/exa_priv.h @@ -248,11 +248,19 @@ extern DevPrivateKeyRec exaScreenPrivateKeyRec; real->mem = priv->Saved##mem; \ } +#ifdef HAVE_TYPEOF +#define swap(priv, real, mem) {\ + typeof(real->mem) tmp = priv->Saved##mem; \ + priv->Saved##mem = real->mem; \ + real->mem = tmp; \ +} +#else #define swap(priv, real, mem) {\ void *tmp = priv->Saved##mem; \ priv->Saved##mem = real->mem; \ real->mem = tmp; \ } +#endif #define EXA_PRE_FALLBACK(_screen_) \ ExaScreenPriv(_screen_); \ @@ -333,8 +341,8 @@ typedef struct { typedef struct { /* GC values from the layer below. */ - GCOps *Savedops; - GCFuncs *Savedfuncs; + const GCOps *Savedops; + const GCFuncs *Savedfuncs; } ExaGCPrivRec, *ExaGCPrivPtr; typedef struct { @@ -422,13 +430,13 @@ void ExaCheckImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); + CharInfoPtr * ppci, void *pglyphBase); void ExaCheckPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); + CharInfoPtr * ppci, void *pglyphBase); void @@ -601,7 +609,7 @@ Bool exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, - pointer pPixData); + void *pPixData); Bool exaDestroyPixmap_classic(PixmapPtr pPixmap); @@ -619,7 +627,7 @@ Bool exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth, int bitsPerPixel, int devKind, - pointer pPixData); + void *pPixData); Bool exaDestroyPixmap_driver(PixmapPtr pPixmap); @@ -636,7 +644,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth, Bool exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData); + int bitsPerPixel, int devKind, void *pPixData); Bool exaDestroyPixmap_mixed(PixmapPtr pPixmap); diff --git a/xorg-server/exa/exa_unaccel.c b/xorg-server/exa/exa_unaccel.c index 3bfbb4fe9..b66eeee7b 100644 --- a/xorg-server/exa/exa_unaccel.c +++ b/xorg-server/exa/exa_unaccel.c @@ -319,7 +319,7 @@ ExaCheckPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, void ExaCheckImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) + CharInfoPtr * ppci, void *pglyphBase) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); @@ -334,7 +334,7 @@ ExaCheckImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, void ExaCheckPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) + CharInfoPtr * ppci, void *pglyphBase) { EXA_PRE_FALLBACK_GC(pGC); EXA_FALLBACK(("to %p (%c), style %d alu %d\n", pDrawable, diff --git a/xorg-server/fb/fb.h b/xorg-server/fb/fb.h index 26957df4c..90577677b 100644 --- a/xorg-server/fb/fb.h +++ b/xorg-server/fb/fb.h @@ -776,7 +776,7 @@ fb24_32ModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData); + int bitsPerPixel, int devKind, void *pPixData); /* * fballpriv.c @@ -1229,7 +1229,7 @@ fbPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr * ppci, pointer pglyphBase); + unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); extern _X_EXPORT void @@ -1237,7 +1237,7 @@ fbImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr * ppci, pointer pglyphBase); + unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase); /* * fbimage.c @@ -1409,7 +1409,7 @@ extern _X_EXPORT void _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap); extern _X_EXPORT Bool - fbSetupScreen(ScreenPtr pScreen, pointer pbits, /* pointer to screen bitmap */ + fbSetupScreen(ScreenPtr pScreen, void *pbits, /* pointer to screen bitmap */ int xsize, /* in pixels */ int ysize, int dpix, /* dots per inch */ int dpiy, int width, /* pixel width of frame buffer */ @@ -1418,7 +1418,7 @@ extern _X_EXPORT Bool extern _X_EXPORT Bool wfbFinishScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, @@ -1430,7 +1430,7 @@ wfbFinishScreenInit(ScreenPtr pScreen, extern _X_EXPORT Bool wfbScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, @@ -1442,14 +1442,14 @@ wfbScreenInit(ScreenPtr pScreen, extern _X_EXPORT Bool fbFinishScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp); extern _X_EXPORT Bool fbScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp); /* diff --git a/xorg-server/fb/fb24_32.c b/xorg-server/fb/fb24_32.c index 5eb81e8f0..ecb39510d 100644 --- a/xorg-server/fb/fb24_32.c +++ b/xorg-server/fb/fb24_32.c @@ -495,7 +495,7 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel) } typedef struct { - pointer pbits; + void *pbits; int width; } miScreenInitParmsRec, *miScreenInitParmsPtr; @@ -526,7 +526,7 @@ fb24_32ModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) + int bitsPerPixel, int devKind, void *pPixData) { int bpp, w; diff --git a/xorg-server/fb/fb24_32.h b/xorg-server/fb/fb24_32.h index 1bec00b80..b357edf38 100644 --- a/xorg-server/fb/fb24_32.h +++ b/xorg-server/fb/fb24_32.h @@ -31,14 +31,14 @@ Bool fb24_32FinishScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp); Bool fb24_32ScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp); #endif diff --git a/xorg-server/fb/fbglyph.c b/xorg-server/fb/fbglyph.c index 3080a7728..4f2904c31 100644 --- a/xorg-server/fb/fbglyph.c +++ b/xorg-server/fb/fbglyph.c @@ -241,7 +241,7 @@ fbPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr * ppci, pointer pglyphBase) + unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); CharInfoPtr pci; @@ -309,7 +309,7 @@ fbImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr * ppciInit, pointer pglyphBase) + unsigned int nglyph, CharInfoPtr * ppciInit, void *pglyphBase) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); CharInfoPtr *ppci; diff --git a/xorg-server/fb/fboverlay.c b/xorg-server/fb/fboverlay.c index c6802e4b4..935bf1b50 100644 --- a/xorg-server/fb/fboverlay.c +++ b/xorg-server/fb/fboverlay.c @@ -104,7 +104,7 @@ fbOverlayWindowLayer(WindowPtr pWin) for (i = 0; i < pScrPriv->nlayers; i++) if (dixLookupPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin)) == - (pointer) pScrPriv->layer[i].u.run.pixmap) + (void *) pScrPriv->layer[i].u.run.pixmap) return i; return 0; } @@ -115,7 +115,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen) int i; FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); PixmapPtr pPixmap; - pointer pbits; + void *pbits; int width; int depth; BoxRec box; @@ -250,8 +250,8 @@ fbOverlayWindowExposures(WindowPtr pWin, Bool fbOverlaySetupScreen(ScreenPtr pScreen, - pointer pbits1, - pointer pbits2, + void *pbits1, + void *pbits2, int xsize, int ysize, int dpix, @@ -287,8 +287,8 @@ fb24_32OverlayCreateScreenResources(ScreenPtr pScreen) Bool fbOverlayFinishScreenInit(ScreenPtr pScreen, - pointer pbits1, - pointer pbits2, + void *pbits1, + void *pbits2, int xsize, int ysize, int dpix, diff --git a/xorg-server/fb/fboverlay.h b/xorg-server/fb/fboverlay.h index 9a93457c7..57c9873c2 100644 --- a/xorg-server/fb/fboverlay.h +++ b/xorg-server/fb/fboverlay.h @@ -38,7 +38,7 @@ typedef void (*fbOverlayPaintKeyProc) (DrawablePtr, RegionPtr, CARD32, int); typedef struct _fbOverlayLayer { union { struct { - pointer pbits; + void *pbits; int width; int depth; } init; @@ -89,8 +89,8 @@ fbOverlayWindowExposures(WindowPtr pWin, extern _X_EXPORT Bool fbOverlaySetupScreen(ScreenPtr pScreen, - pointer pbits1, - pointer pbits2, + void *pbits1, + void *pbits2, int xsize, int ysize, int dpix, @@ -99,8 +99,8 @@ fbOverlaySetupScreen(ScreenPtr pScreen, extern _X_EXPORT Bool fbOverlayFinishScreenInit(ScreenPtr pScreen, - pointer pbits1, - pointer pbits2, + void *pbits1, + void *pbits2, int xsize, int ysize, int dpix, diff --git a/xorg-server/fb/fbpixmap.c b/xorg-server/fb/fbpixmap.c index f287ca78c..1280a780c 100644 --- a/xorg-server/fb/fbpixmap.c +++ b/xorg-server/fb/fbpixmap.c @@ -66,7 +66,7 @@ fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp, pPixmap->drawable.height = height; pPixmap->devKind = paddedWidth; pPixmap->refcnt = 1; - pPixmap->devPrivate.ptr = (pointer) ((char *) pPixmap + base + adjust); + pPixmap->devPrivate.ptr = (void *) ((char *) pPixmap + base + adjust); pPixmap->master_pixmap = NULL; #ifdef FB_DEBUG diff --git a/xorg-server/fb/fbscreen.c b/xorg-server/fb/fbscreen.c index f9080a445..b2b973974 100644 --- a/xorg-server/fb/fbscreen.c +++ b/xorg-server/fb/fbscreen.c @@ -90,7 +90,7 @@ _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap) } Bool -fbSetupScreen(ScreenPtr pScreen, pointer pbits, /* pointer to screen bitmap */ +fbSetupScreen(ScreenPtr pScreen, void *pbits, /* pointer to screen bitmap */ int xsize, /* in pixels */ int ysize, int dpix, /* dots per inch */ int dpiy, int width, /* pixel width of frame buffer */ @@ -135,7 +135,7 @@ fbSetupScreen(ScreenPtr pScreen, pointer pbits, /* pointer to screen bitmap */ #ifdef FB_ACCESS_WRAPPER Bool wfbFinishScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, @@ -146,7 +146,7 @@ wfbFinishScreenInit(ScreenPtr pScreen, #else Bool fbFinishScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp) #endif { @@ -224,7 +224,7 @@ fbFinishScreenInit(ScreenPtr pScreen, #ifdef FB_ACCESS_WRAPPER Bool wfbScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, @@ -242,7 +242,7 @@ wfbScreenInit(ScreenPtr pScreen, #else Bool fbScreenInit(ScreenPtr pScreen, - pointer pbits, + void *pbits, int xsize, int ysize, int dpix, int dpiy, int width, int bpp) { if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp)) diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c index 80c7fa2e6..bb75af774 100644 --- a/xorg-server/glx/glxcmds.c +++ b/xorg-server/glx/glxcmds.c @@ -136,7 +136,7 @@ _X_HIDDEN int validGlxContext(ClientPtr client, XID id, int access_mode, __GLXcontext ** context, int *err) { - *err = dixLookupResourceByType((pointer *) context, id, + *err = dixLookupResourceByType((void **) context, id, __glXContextRes, client, access_mode); if (*err != Success || (*context)->idExists == GL_FALSE) { client->errorValue = id; @@ -154,7 +154,7 @@ validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, { int rc; - rc = dixLookupResourceByType((pointer *) drawable, id, + rc = dixLookupResourceByType((void **) drawable, id, __glXDrawableRes, client, access_mode); if (rc != Success && rc != BadValue) { *err = rc; @@ -2512,7 +2512,7 @@ __glXpresentCompleteNotify(WindowPtr window, CARD8 present_mode, CARD32 serial, int glx_type; int rc; - rc = dixLookupResourceByType((pointer *) &drawable, window->drawable.id, + rc = dixLookupResourceByType((void **) &drawable, window->drawable.id, __glXDrawableRes, serverClient, DixGetAttrAccess); if (rc != Success) diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c index 7e1398bb9..31cdfb3c9 100644 --- a/xorg-server/glx/glxext.c +++ b/xorg-server/glx/glxext.c @@ -169,7 +169,7 @@ __glXAddContext(__GLXcontext * cx) { /* Register this context as a resource. */ - if (!AddResource(cx->id, __glXContextRes, (pointer)cx)) { + if (!AddResource(cx->id, __glXContextRes, (void *)cx)) { return False; } @@ -283,7 +283,7 @@ glxGetClient(ClientPtr pClient) } static void -glxClientCallback(CallbackListPtr *list, pointer closure, pointer data) +glxClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; diff --git a/xorg-server/hw/dmx/config/Canvas.c b/xorg-server/hw/dmx/config/Canvas.c index f0586e509..103103346 100644 --- a/xorg-server/hw/dmx/config/Canvas.c +++ b/xorg-server/hw/dmx/config/Canvas.c @@ -98,10 +98,10 @@ static XtResource resources[] = { {XtNcallback, XtCCallback, XtRCallback, sizeof(XtCallbackList), offset(input_callback), XtRCallback, NULL} , - {XtNcanvasExposeCallback, XtCcanvasExposeCallback, XtRCallback, + {(char *) XtNcanvasExposeCallback, (char *) XtCcanvasExposeCallback, XtRCallback, sizeof(XtCallbackList), offset(expose_callback), XtRCallback, NULL} , - {XtNcanvasResizeCallback, XtCcanvasResizeCallback, XtRCallback, + {(char *) XtNcanvasResizeCallback, (char *) XtCcanvasResizeCallback, XtRCallback, sizeof(XtCallbackList), offset(resize_callback), XtRCallback, NULL} , }; @@ -109,7 +109,7 @@ static XtResource resources[] = { #undef offset static XtActionsRec actions[] = { - {"canvas", CanvasAction}, + {(char *) "canvas", CanvasAction}, }; static char translations[] = "<Key>: canvas()\n\ @@ -123,7 +123,7 @@ CanvasClassRec canvasClassRec = { /* core */ { (WidgetClass) Superclass, /* superclass */ - "Canvas", /* class_name */ + (char *) "Canvas", /* class_name */ sizeof(CanvasRec), /* widget_size */ NULL, /* class_initialize */ NULL, /* class_part_initialize */ diff --git a/xorg-server/hw/dmx/config/xdmxconfig.c b/xorg-server/hw/dmx/config/xdmxconfig.c index 2121dd781..2b7b9683b 100644 --- a/xorg-server/hw/dmx/config/xdmxconfig.c +++ b/xorg-server/hw/dmx/config/xdmxconfig.c @@ -974,9 +974,9 @@ main(int argc, char **argv) const char *canvastrans = "<Btn3Down>: placeMenu() XtMenuPopup(buttonpopup)"; XtActionsRec actiontable[] = { - {"openOk", dmxConfigOkAction}, - {"placeMenu", dmxConfigPlaceMenu}, - {"noop", NULL} + {(char *) "openOk", dmxConfigOkAction}, + {(char *) "placeMenu", dmxConfigPlaceMenu}, + {(char *) "noop", NULL} }; dmxConfigFilename = XtNewString((argc >= 2) ? argv[1] : ""); diff --git a/xorg-server/hw/dmx/dmx.c b/xorg-server/hw/dmx/dmx.c index 0f7cb5c64..99e970cb9 100644 --- a/xorg-server/hw/dmx/dmx.c +++ b/xorg-server/hw/dmx/dmx.c @@ -268,7 +268,7 @@ ProcDMXForceWindowCreation(ClientPtr client) PanoramiXRes *win; int i; - if (Success != dixLookupResourceByType((pointer *) &win, + if (Success != dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, client, DixReadAccess)) return -1; /* BadWindow */ @@ -556,7 +556,7 @@ dmxPopulatePanoramiX(ClientPtr client, Window window, int count = 0; DMXWindowAttributesRec attr; - if (Success != dixLookupResourceByType((pointer *) &win, + if (Success != dixLookupResourceByType((void **) &win, window, XRT_WINDOW, client, DixReadAccess)) return -1; /* BadWindow */ diff --git a/xorg-server/hw/dmx/dmxclient.h b/xorg-server/hw/dmx/dmxclient.h index 19dfdbe16..be8116f14 100644 --- a/xorg-server/hw/dmx/dmxclient.h +++ b/xorg-server/hw/dmx/dmxclient.h @@ -118,17 +118,6 @@ typedef XID KeySym64; #undef KeySym #endif -/* These are in exglobals.h, but that conflicts with xkbsrv.h */ -extern int ProximityIn; -extern int ProximityOut; -extern int DeviceValuator; -extern int DeviceMotionNotify; -extern int DeviceFocusIn; -extern int DeviceFocusOut; -extern int DeviceStateNotify; -extern int DeviceMappingNotify; -extern int ChangeDeviceNotify; - /* Some protocol gets included last, after undefines. */ #include <X11/XKBlib.h> #include <X11/extensions/XKBproto.h> diff --git a/xorg-server/hw/dmx/dmxextension.c b/xorg-server/hw/dmx/dmxextension.c index c6c6a8e6d..fcc97e3df 100644 --- a/xorg-server/hw/dmx/dmxextension.c +++ b/xorg-server/hw/dmx/dmxextension.c @@ -728,7 +728,7 @@ static Bool FoundPixImage; * another screen with the same image. If so, copy the pixmap image * from the existing screen to the newly created pixmap. */ static void -dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type, pointer p) +dmxBERestorePixmapImage(void *value, XID id, RESTYPE type, void *p) { if ((type & TypeMask) == (XRT_PIXMAP & TypeMask)) { PixmapPtr pDst = (PixmapPtr) p; @@ -737,7 +737,7 @@ dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type, pointer p) PixmapPtr pPix; int i; - dixLookupResourceByType((pointer *) &pPix, pXinPix->info[idx].id, + dixLookupResourceByType((void **) &pPix, pXinPix->info[idx].id, RT_PIXMAP, NullClient, DixUnknownAccess); if (pPix != pDst) return; /* Not a match.... Next! */ @@ -749,7 +749,7 @@ dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type, pointer p) if (i == idx) continue; /* Self replication is bad */ - dixLookupResourceByType((pointer *) &pSrc, pXinPix->info[i].id, + dixLookupResourceByType((void **) &pSrc, pXinPix->info[i].id, RT_PIXMAP, NullClient, DixUnknownAccess); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); if (pSrcPriv->pixmap) { @@ -828,7 +828,7 @@ dmxBERestorePixmap(PixmapPtr pPixmap) for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindAllClientResources(clients[i], dmxBERestorePixmapImage, - (pointer) pPixmap); + (void *) pPixmap); /* No corresponding pixmap image was found on other screens, so we * need to copy it from the saved image when the screen was detached @@ -895,7 +895,7 @@ dmxBERestorePixmap(PixmapPtr pPixmap) * number passed in as \a n and calls the appropriate DMX function to * create the associated resource on the back-end server. */ static void -dmxBECreateResources(pointer value, XID id, RESTYPE type, pointer n) +dmxBECreateResources(void *value, XID id, RESTYPE type, void *n) { int scrnNum = (uintptr_t) n; ScreenPtr pScreen = screenInfo.screens[scrnNum]; @@ -1121,7 +1121,7 @@ dmxCompareScreens(DMXScreenInfo * new, DMXScreenInfo * old) /** Restore Render's picture */ static void -dmxBERestoreRenderPict(pointer value, XID id, pointer n) +dmxBERestoreRenderPict(void *value, XID id, void *n) { PicturePtr pPicture = value; /* The picture */ DrawablePtr pDraw = pPicture->pDrawable; /* The picture's drawable */ @@ -1145,7 +1145,7 @@ dmxBERestoreRenderPict(pointer value, XID id, pointer n) /** Restore Render's glyphs */ static void -dmxBERestoreRenderGlyph(pointer value, XID id, pointer n) +dmxBERestoreRenderGlyph(void *value, XID id, void *n) { GlyphSetPtr glyphSet = value; int scrnNum = (uintptr_t) n; @@ -1340,7 +1340,7 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindAllClientResources(clients[i], dmxBECreateResources, - (pointer) (uintptr_t) idx); + (void *) (uintptr_t) idx); /* Create window hierarchy (top down) */ dmxBECreateWindowTree(idx); @@ -1350,14 +1350,14 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) if (clients[i]) FindClientResourcesByType(clients[i], PictureType, dmxBERestoreRenderPict, - (pointer) (uintptr_t) idx); + (void *) (uintptr_t) idx); /* Restore the glyph state for RENDER */ for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindClientResourcesByType(clients[i], GlyphSetType, dmxBERestoreRenderGlyph, - (pointer) (uintptr_t) idx); + (void *) (uintptr_t) idx); /* Refresh screen by generating exposure events for all windows */ dmxForceExposures(idx); @@ -1425,7 +1425,7 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) /** Search the Xinerama XRT_PIXMAP resources for the pixmap that needs * to have its image saved. */ static void -dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type, pointer p) +dmxBEFindPixmapImage(void *value, XID id, RESTYPE type, void *p) { if ((type & TypeMask) == (XRT_PIXMAP & TypeMask)) { PixmapPtr pDst = (PixmapPtr) p; @@ -1434,7 +1434,7 @@ dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type, pointer p) PixmapPtr pPix; int i; - dixLookupResourceByType((pointer *) &pPix, pXinPix->info[idx].id, + dixLookupResourceByType((void **) &pPix, pXinPix->info[idx].id, RT_PIXMAP, NullClient, DixUnknownAccess); if (pPix != pDst) return; /* Not a match.... Next! */ @@ -1446,7 +1446,7 @@ dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type, pointer p) if (i == idx) continue; /* Self replication is bad */ - dixLookupResourceByType((pointer *) &pSrc, pXinPix->info[i].id, + dixLookupResourceByType((void **) &pSrc, pXinPix->info[i].id, RT_PIXMAP, NullClient, DixUnknownAccess); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); if (pSrcPriv->pixmap) { @@ -1482,7 +1482,7 @@ dmxBESavePixmap(PixmapPtr pPixmap) for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindAllClientResources(clients[i], dmxBEFindPixmapImage, - (pointer) pPixmap); + (void *) pPixmap); /* Save the image only if there is no other screens that have a * pixmap that corresponds to the one we are trying to save. */ @@ -1522,7 +1522,7 @@ dmxBESavePixmap(PixmapPtr pPixmap) * number passed in as \a n and calls the appropriate DMX function to * free the associated resource on the back-end server. */ static void -dmxBEDestroyResources(pointer value, XID id, RESTYPE type, pointer n) +dmxBEDestroyResources(void *value, XID id, RESTYPE type, void *n) { int scrnNum = (uintptr_t) n; ScreenPtr pScreen = screenInfo.screens[scrnNum]; @@ -1683,7 +1683,7 @@ dmxDetachScreen(int idx) for (i = currentMaxClients; --i >= 0;) if (clients[i]) FindAllClientResources(clients[i], dmxBEDestroyResources, - (pointer) (uintptr_t) idx); + (void *) (uintptr_t) idx); /* Free scratch GCs */ dmxBEDestroyScratchGCs(idx); diff --git a/xorg-server/hw/dmx/dmxfont.c b/xorg-server/hw/dmx/dmxfont.c index 7ef7ad971..6b81826c9 100644 --- a/xorg-server/hw/dmx/dmxfont.c +++ b/xorg-server/hw/dmx/dmxfont.c @@ -460,7 +460,7 @@ dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont) pFontPriv->refcnt = 0; } - FontSetPrivate(pFont, dmxFontPrivateIndex, (pointer) pFontPriv); + FontSetPrivate(pFont, dmxFontPrivateIndex, (void *) pFontPriv); if (dmxScreen->beDisplay) { if (!dmxBELoadFont(pScreen, pFont)) diff --git a/xorg-server/hw/dmx/dmxgc.c b/xorg-server/hw/dmx/dmxgc.c index 703aeb336..2d61ea2f7 100644 --- a/xorg-server/hw/dmx/dmxgc.c +++ b/xorg-server/hw/dmx/dmxgc.c @@ -378,7 +378,7 @@ dmxDestroyGC(GCPtr pGC) /** Change the clip rects for a GC. */ void -dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +dmxChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { ScreenPtr pScreen = pGC->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; diff --git a/xorg-server/hw/dmx/dmxgc.h b/xorg-server/hw/dmx/dmxgc.h index 7b99d88c6..c8ecb53a0 100644 --- a/xorg-server/hw/dmx/dmxgc.h +++ b/xorg-server/hw/dmx/dmxgc.h @@ -55,7 +55,7 @@ extern void dmxValidateGC(GCPtr pGC, unsigned long changes, extern void dmxChangeGC(GCPtr pGC, unsigned long mask); extern void dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst); extern void dmxDestroyGC(GCPtr pGC); -extern void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); +extern void dmxChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); extern void dmxDestroyClip(GCPtr pGC); extern void dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc); diff --git a/xorg-server/hw/dmx/dmxgcops.c b/xorg-server/hw/dmx/dmxgcops.c index 19330668a..aa7c8eb54 100644 --- a/xorg-server/hw/dmx/dmxgcops.c +++ b/xorg-server/hw/dmx/dmxgcops.c @@ -508,7 +508,7 @@ dmxImageText16(DrawablePtr pDrawable, GCPtr pGC, void dmxImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) + CharInfoPtr * ppci, void *pglyphBase) { /* Error -- this should never happen! */ } @@ -517,7 +517,7 @@ dmxImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, void dmxPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) + CharInfoPtr * ppci, void *pglyphBase) { /* Error -- this should never happen! */ } @@ -551,7 +551,7 @@ dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw) if (pDrawable->type != DRAWABLE_PIXMAP) return NULL; - if (Success != dixLookupResourceByType((pointer *) &pXinPix, + if (Success != dixLookupResourceByType((void **) &pXinPix, pDrawable->id, XRT_PIXMAP, NullClient, DixUnknownAccess)) return NULL; @@ -562,7 +562,7 @@ dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw) PixmapPtr pSrc; dmxPixPrivPtr pSrcPriv; - dixLookupResourceByType((pointer *) &pSrc, pXinPix->info[i].id, + dixLookupResourceByType((void **) &pSrc, pXinPix->info[i].id, RT_PIXMAP, NullClient, DixUnknownAccess); pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc); if (pSrcPriv->pixmap) { diff --git a/xorg-server/hw/dmx/dmxgcops.h b/xorg-server/hw/dmx/dmxgcops.h index 4ba0ad500..529b6ffc6 100644 --- a/xorg-server/hw/dmx/dmxgcops.h +++ b/xorg-server/hw/dmx/dmxgcops.h @@ -78,10 +78,10 @@ extern void dmxImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars); extern void dmxImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); + CharInfoPtr * ppci, void *pglyphBase); extern void dmxPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); + CharInfoPtr * ppci, void *pglyphBase); extern void dmxPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, int w, int h, int x, int y); diff --git a/xorg-server/hw/dmx/dmxpict.c b/xorg-server/hw/dmx/dmxpict.c index c9762c2f1..64d0ae150 100644 --- a/xorg-server/hw/dmx/dmxpict.c +++ b/xorg-server/hw/dmx/dmxpict.c @@ -285,7 +285,7 @@ dmxProcRenderCreateGlyphSet(ClientPtr client) /* Store glyphsets from backends in glyphSet->devPrivate ????? */ /* Make sure we handle all errors here!! */ - dixLookupResourceByType((pointer *) &glyphSet, + dixLookupResourceByType((void **) &glyphSet, stuff->gsid, GlyphSetType, client, DixDestroyAccess); @@ -332,7 +332,7 @@ dmxProcRenderFreeGlyphSet(ClientPtr client) REQUEST(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - dixLookupResourceByType((pointer *) &glyphSet, + dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixDestroyAccess); @@ -378,7 +378,7 @@ dmxProcRenderAddGlyphs(ClientPtr client) CARD8 *bits; int nbytes; - dixLookupResourceByType((pointer *) &glyphSet, + dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); @@ -423,7 +423,7 @@ dmxProcRenderFreeGlyphs(ClientPtr client) REQUEST(xRenderFreeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - dixLookupResourceByType((pointer *) &glyphSet, + dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixWriteAccess); @@ -498,14 +498,14 @@ dmxProcRenderCompositeGlyphs(ClientPtr client) GlyphSetPtr glyphSet; dmxGlyphPrivPtr glyphPriv; - dixLookupResourceByType((pointer *) &pSrc, + dixLookupResourceByType((void **) &pSrc, stuff->src, PictureType, client, DixReadAccess); pSrcPriv = DMX_GET_PICT_PRIV(pSrc); if (!pSrcPriv->pict) return ret; - dixLookupResourceByType((pointer *) &pDst, + dixLookupResourceByType((void **) &pDst, stuff->dst, PictureType, client, DixWriteAccess); @@ -524,7 +524,7 @@ dmxProcRenderCompositeGlyphs(ClientPtr client) return ret; if (stuff->maskFormat) - dixLookupResourceByType((pointer *) &pFmt, + dixLookupResourceByType((void **) &pFmt, stuff->maskFormat, PictFormatType, client, DixReadAccess); else @@ -585,7 +585,7 @@ dmxProcRenderCompositeGlyphs(ClientPtr client) curGlyph = glyphs; curElt = elts; - dixLookupResourceByType((pointer *) &glyphSet, + dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); @@ -595,7 +595,7 @@ dmxProcRenderCompositeGlyphs(ClientPtr client) buffer += sizeof(xGlyphElt); if (elt->len == 0xff) { - dixLookupResourceByType((pointer *) &glyphSet, + dixLookupResourceByType((void **) &glyphSet, *((CARD32 *) buffer), GlyphSetType, client, DixReadAccess); glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); @@ -894,7 +894,7 @@ dmxDestroyPicture(PicturePtr pPicture) /** Change the picture's list of clip rectangles. */ int -dmxChangePictureClip(PicturePtr pPicture, int clipType, pointer value, int n) +dmxChangePictureClip(PicturePtr pPicture, int clipType, void *value, int n) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; diff --git a/xorg-server/hw/dmx/dmxpict.h b/xorg-server/hw/dmx/dmxpict.h index 6c37be924..080da3bef 100644 --- a/xorg-server/hw/dmx/dmxpict.h +++ b/xorg-server/hw/dmx/dmxpict.h @@ -65,7 +65,7 @@ extern Bool dmxDestroyPictureList(WindowPtr pWindow); extern int dmxCreatePicture(PicturePtr pPicture); extern void dmxDestroyPicture(PicturePtr pPicture); extern int dmxChangePictureClip(PicturePtr pPicture, int clipType, - pointer value, int n); + void *value, int n); extern void dmxDestroyPictureClip(PicturePtr pPicture); extern void dmxChangePicture(PicturePtr pPicture, Mask mask); extern void dmxValidatePicture(PicturePtr pPicture, Mask mask); diff --git a/xorg-server/hw/dmx/dmxstat.c b/xorg-server/hw/dmx/dmxstat.c index 0d8c22a9e..0ae5107a4 100644 --- a/xorg-server/hw/dmx/dmxstat.c +++ b/xorg-server/hw/dmx/dmxstat.c @@ -175,7 +175,7 @@ dmxStatSync(DMXScreenInfo * dmxScreen, /* Actually do the work of printing out the human-readable message. */ static CARD32 -dmxStatCallback(OsTimerPtr timer, CARD32 t, pointer arg) +dmxStatCallback(OsTimerPtr timer, CARD32 t, void *arg) { int i, j; static int header = 0; diff --git a/xorg-server/hw/dmx/dmxsync.c b/xorg-server/hw/dmx/dmxsync.c index bf28584b4..81dbbc64d 100644 --- a/xorg-server/hw/dmx/dmxsync.c +++ b/xorg-server/hw/dmx/dmxsync.c @@ -82,7 +82,7 @@ dmxDoSync(DMXScreenInfo * dmxScreen) } static CARD32 -dmxSyncCallback(OsTimerPtr timer, CARD32 time, pointer arg) +dmxSyncCallback(OsTimerPtr timer, CARD32 time, void *arg) { int i; @@ -99,13 +99,13 @@ dmxSyncCallback(OsTimerPtr timer, CARD32 time, pointer arg) } static void -dmxSyncBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask) +dmxSyncBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) { TimerForce(dmxSyncTimer); } static void -dmxSyncWakeupHandler(pointer blockData, int result, pointer pReadMask) +dmxSyncWakeupHandler(void *blockData, int result, void *pReadMask) { } diff --git a/xorg-server/hw/dmx/dmxwindow.c b/xorg-server/hw/dmx/dmxwindow.c index 9b8a3840e..1c235273c 100644 --- a/xorg-server/hw/dmx/dmxwindow.c +++ b/xorg-server/hw/dmx/dmxwindow.c @@ -86,7 +86,7 @@ dmxCreateRootWindow(WindowPtr pWindow) parent = dmxScreen->scrnWin; /* This is our "Screen" window */ visual = dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual; - dixLookupResourceByType((pointer *) &pCmap, wColormap(pWindow), + dixLookupResourceByType((void **) &pCmap, wColormap(pWindow), RT_COLORMAP, NullClient, DixUnknownAccess); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); @@ -192,7 +192,7 @@ dmxGetDefaultWindowAttributes(WindowPtr pWindow, ColormapPtr pCmap; dmxColormapPrivPtr pCmapPriv; - dixLookupResourceByType((pointer *) &pCmap, wColormap(pWindow), + dixLookupResourceByType((void **) &pCmap, wColormap(pWindow), RT_COLORMAP, NullClient, DixUnknownAccess); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); *cmap = pCmapPriv->cmap; @@ -561,7 +561,7 @@ dmxDoChangeWindowAttributes(WindowPtr pWindow, ColormapPtr pCmap; dmxColormapPrivPtr pCmapPriv; - dixLookupResourceByType((pointer *) &pCmap, wColormap(pWindow), + dixLookupResourceByType((void **) &pCmap, wColormap(pWindow), RT_COLORMAP, NullClient, DixUnknownAccess); pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap); attribs->colormap = pCmapPriv->cmap; diff --git a/xorg-server/hw/dmx/glxProxy/glxcmds.c b/xorg-server/hw/dmx/glxProxy/glxcmds.c index 190eeefe2..964db4069 100644 --- a/xorg-server/hw/dmx/glxProxy/glxcmds.c +++ b/xorg-server/hw/dmx/glxProxy/glxcmds.c @@ -195,7 +195,7 @@ CreateContext(__GLXclientState * cl, shareglxc = NULL; } else { - dixLookupResourceByType((pointer *) &shareglxc, shareList, + dixLookupResourceByType((void **) &shareglxc, shareList, __glXContextRes, NullClient, DixUnknownAccess); if (!shareglxc) { client->errorValue = shareList; @@ -425,7 +425,7 @@ CreateContext(__GLXclientState * cl, /* ** Register this context as a resource. */ - if (!AddResource(gcId, __glXContextRes, (pointer) glxc)) { + if (!AddResource(gcId, __glXContextRes, (void *) glxc)) { free(glxc->real_ids); free(glxc->real_vids); free(glxc); @@ -511,14 +511,14 @@ __glXBindSwapBarrierSGIX(__GLXclientState * cl, GLbyte * pc) rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixGetAttrAccess); if (rc != Success) { - dixLookupResourceByType((pointer *) &pGlxPixmap, req->drawable, + dixLookupResourceByType((void **) &pGlxPixmap, req->drawable, __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) pDraw = pGlxPixmap->pDraw; } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxWindow, req->drawable, + dixLookupResourceByType((void **) &pGlxWindow, req->drawable, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) pDraw = pGlxWindow->pDraw; @@ -544,14 +544,14 @@ __glXJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc) rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixManageAccess); if (rc != Success) { - dixLookupResourceByType((pointer *) &pGlxPixmap, req->drawable, + dixLookupResourceByType((void **) &pGlxPixmap, req->drawable, __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) pDraw = pGlxPixmap->pDraw; } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxWindow, req->drawable, + dixLookupResourceByType((void **) &pGlxWindow, req->drawable, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) pDraw = pGlxWindow->pDraw; @@ -566,7 +566,7 @@ __glXJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc) rc = dixLookupDrawable(&pMember, req->member, client, 0, DixGetAttrAccess); if (rc != Success) { - dixLookupResourceByType((pointer *) &pGlxPixmap, req->member, + dixLookupResourceByType((void **) &pGlxPixmap, req->member, __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) @@ -574,7 +574,7 @@ __glXJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc) } if (!pMember && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxWindow, req->member, + dixLookupResourceByType((void **) &pGlxWindow, req->member, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) @@ -605,7 +605,7 @@ __glXDestroyContext(__GLXclientState * cl, GLbyte * pc) int to_screen = 0; int s; - dixLookupResourceByType((pointer *) &glxc, gcId, __glXContextRes, + dixLookupResourceByType((void **) &glxc, gcId, __glXContextRes, NullClient, DixUnknownAccess); if (glxc) { /* @@ -880,7 +880,7 @@ MakeCurrent(__GLXclientState * cl, ** Lookup new context. It must not be current for someone else. */ if (contextId != None) { - dixLookupResourceByType((pointer *) &glxc, contextId, __glXContextRes, + dixLookupResourceByType((void **) &glxc, contextId, __glXContextRes, NullClient, DixUnknownAccess); if (!glxc) { client->errorValue = contextId; @@ -935,7 +935,7 @@ MakeCurrent(__GLXclientState * cl, } if (!pDraw) { - dixLookupResourceByType((pointer *) &pGlxPixmap, drawId, + dixLookupResourceByType((void **) &pGlxPixmap, drawId, __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) { @@ -960,7 +960,7 @@ MakeCurrent(__GLXclientState * cl, } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxWindow, drawId, + dixLookupResourceByType((void **) &pGlxWindow, drawId, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) { @@ -983,7 +983,7 @@ MakeCurrent(__GLXclientState * cl, } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxPbuffer, drawId, + dixLookupResourceByType((void **) &pGlxPbuffer, drawId, __glXPbufferRes, NullClient, DixUnknownAccess); if (pGlxPbuffer) { @@ -1050,7 +1050,7 @@ MakeCurrent(__GLXclientState * cl, } if (!pReadDraw) { - dixLookupResourceByType((pointer *) &pReadGlxPixmap, readId, + dixLookupResourceByType((void **) &pReadGlxPixmap, readId, __glXPixmapRes, NullClient, DixUnknownAccess); if (pReadGlxPixmap) { @@ -1072,7 +1072,7 @@ MakeCurrent(__GLXclientState * cl, } if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxReadWindow, readId, + dixLookupResourceByType((void **) &pGlxReadWindow, readId, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxReadWindow) { @@ -1094,7 +1094,7 @@ MakeCurrent(__GLXclientState * cl, } if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxReadPbuffer, readId, + dixLookupResourceByType((void **) &pGlxReadPbuffer, readId, __glXPbufferRes, NullClient, DixUnknownAccess); if (pGlxReadPbuffer) { @@ -1236,14 +1236,14 @@ MakeCurrent(__GLXclientState * cl, to_screen = screenInfo.numScreens - 1; if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) { - dixLookupResourceByClass((pointer *) &pXinDraw, + dixLookupResourceByClass((void **) &pXinDraw, pDraw->id, XRC_DRAWABLE, client, DixReadAccess); } if (pReadDraw && pReadDraw != pDraw && new_reply.readType != GLX_PBUFFER_TYPE) { - dixLookupResourceByClass((pointer *) &pXinReadDraw, + dixLookupResourceByClass((void **) &pXinReadDraw, pReadDraw->id, XRC_DRAWABLE, client, DixReadAccess); } @@ -1460,7 +1460,7 @@ __glXIsDirect(__GLXclientState * cl, GLbyte * pc) /* ** Find the GL context. */ - dixLookupResourceByType((pointer *) &glxc, req->context, __glXContextRes, + dixLookupResourceByType((void **) &glxc, req->context, __glXContextRes, NullClient, DixUnknownAccess); if (!glxc) { client->errorValue = req->context; @@ -1619,13 +1619,13 @@ __glXCopyContext(__GLXclientState * cl, GLbyte * pc) /* ** Check that each context exists. */ - dixLookupResourceByType((pointer *) &src, source, __glXContextRes, + dixLookupResourceByType((void **) &src, source, __glXContextRes, NullClient, DixUnknownAccess); if (!src) { client->errorValue = source; return __glXBadContext; } - dixLookupResourceByType((pointer *) &dst, dest, __glXContextRes, + dixLookupResourceByType((void **) &dst, dest, __glXContextRes, NullClient, DixUnknownAccess); if (!dst) { client->errorValue = dest; @@ -1925,7 +1925,7 @@ CreateGLXPixmap(__GLXclientState * cl, from_screen = 0; to_screen = screenInfo.numScreens - 1; - dixLookupResourceByClass((pointer *) &pXinDraw, + dixLookupResourceByClass((void **) &pXinDraw, pDraw->id, XRC_DRAWABLE, client, DixReadAccess); } @@ -2055,7 +2055,7 @@ __glXDestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc) /* ** Check if it's a valid GLX pixmap. */ - dixLookupResourceByType((pointer *) &pGlxPixmap, glxpixmap, + dixLookupResourceByType((void **) &pGlxPixmap, glxpixmap, __glXPixmapRes, NullClient, DixUnknownAccess); if (!pGlxPixmap) { client->errorValue = glxpixmap; @@ -2141,7 +2141,7 @@ __glXDoSwapBuffers(__GLXclientState * cl, XID drawId, GLXContextTag tag) } if (!pDraw) { - dixLookupResourceByType((pointer *) &pGlxPixmap, drawId, + dixLookupResourceByType((void **) &pGlxPixmap, drawId, __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) { /* @@ -2153,7 +2153,7 @@ __glXDoSwapBuffers(__GLXclientState * cl, XID drawId, GLXContextTag tag) } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxWindow, drawId, + dixLookupResourceByType((void **) &pGlxWindow, drawId, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) { /* @@ -2183,7 +2183,7 @@ __glXDoSwapBuffers(__GLXclientState * cl, XID drawId, GLXContextTag tag) if (!noPanoramiXExtension) { from_screen = 0; to_screen = screenInfo.numScreens - 1; - dixLookupResourceByClass((pointer *) &pXinDraw, + dixLookupResourceByClass((void **) &pXinDraw, pDraw->id, XRC_DRAWABLE, client, DixReadAccess); } @@ -2291,7 +2291,7 @@ __glXSwapBuffers(__GLXclientState * cl, GLbyte * pc) } if (!pDraw) { - dixLookupResourceByType((pointer *) &pGlxPixmap, drawId, + dixLookupResourceByType((void **) &pGlxPixmap, drawId, __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) { /* @@ -2302,7 +2302,7 @@ __glXSwapBuffers(__GLXclientState * cl, GLbyte * pc) } if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) { - dixLookupResourceByType((pointer *) &pGlxWindow, drawId, + dixLookupResourceByType((void **) &pGlxWindow, drawId, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) { /* @@ -2817,12 +2817,12 @@ __glXUseXFont(__GLXclientState * cl, GLbyte * pc) ** Font can actually be either the ID of a font or the ID of a GC ** containing a font. */ - dixLookupResourceByType((pointer *) &pFont, req->font, RT_FONT, + dixLookupResourceByType((void **) &pFont, req->font, RT_FONT, NullClient, DixUnknownAccess); if (!pFont) { GC *pGC; - dixLookupResourceByType((pointer *) &pGC, req->font, + dixLookupResourceByType((void **) &pGC, req->font, RT_GC, NullClient, DixUnknownAccess); if (!pGC) { client->errorValue = req->font; @@ -3082,7 +3082,7 @@ __glXCreateWindow(__GLXclientState * cl, GLbyte * pc) VisualPtr pVisual; VisualID visId; int i, rc; - pointer val; + void *val; /* ** Check if windowId is valid @@ -3184,7 +3184,7 @@ __glXDestroyWindow(__GLXclientState * cl, GLbyte * pc) ClientPtr client = cl->client; xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; XID glxwindow = req->glxwindow; - pointer val; + void *val; /* ** Check if it's a valid GLX window. @@ -3216,7 +3216,7 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc) int nReplyBytes; req = (xGLXQueryContextReq *) pc; - dixLookupResourceByType((pointer *) &ctx, req->context, __glXContextRes, + dixLookupResourceByType((void **) &ctx, req->context, __glXContextRes, NullClient, DixUnknownAccess); if (!ctx) { client->errorValue = req->context; @@ -3266,7 +3266,7 @@ __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc) int nReplyBytes; req = (xGLXQueryContextInfoEXTReq *) pc; - dixLookupResourceByType((pointer *) &ctx, + dixLookupResourceByType((void **) &ctx, req->context, __glXContextRes, client, DixReadAccess); @@ -3439,7 +3439,7 @@ __glXDestroyPbuffer(__GLXclientState * cl, GLbyte * pc) /* ** Check if it's a valid Pbuffer */ - dixLookupResourceByType((pointer *) &pGlxPbuffer, pbuffer, + dixLookupResourceByType((void **) &pGlxPbuffer, pbuffer, __glXPbufferRes, NullClient, DixUnknownAccess); if (!pGlxPbuffer) { client->errorValue = pbuffer; @@ -3514,7 +3514,7 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) if (!pDraw) { __GLXpixmap *pGlxPixmap; - dixLookupResourceByType((pointer *) &pGlxPixmap, + dixLookupResourceByType((void **) &pGlxPixmap, drawId, __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) { @@ -3527,7 +3527,7 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) if (!pDraw) { __glXWindow *pGlxWindow; - dixLookupResourceByType((pointer *) &pGlxWindow, + dixLookupResourceByType((void **) &pGlxWindow, drawId, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) { @@ -3540,7 +3540,7 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) if (!pDraw) { __glXPbuffer *pGlxPbuffer; - dixLookupResourceByType((pointer *) &pGlxPbuffer, + dixLookupResourceByType((void **) &pGlxPbuffer, drawId, __glXPbufferRes, NullClient, DixUnknownAccess); if (pGlxPbuffer) { @@ -3567,7 +3567,7 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) #ifdef PANORAMIX if (!noPanoramiXExtension) { - if (Success != dixLookupResourceByClass((pointer *) &pXinDraw, + if (Success != dixLookupResourceByClass((void **) &pXinDraw, pDraw->id, XRC_DRAWABLE, client, DixReadAccess)) { client->errorValue = drawId; @@ -3676,7 +3676,7 @@ __glXChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc) if (!pDraw) { __GLXpixmap *pGlxPixmap; - dixLookupResourceByType((pointer *) &pGlxPixmap, + dixLookupResourceByType((void **) &pGlxPixmap, drawId, __glXPixmapRes, NullClient, DixUnknownAccess); if (pGlxPixmap) { @@ -3689,7 +3689,7 @@ __glXChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc) if (!pDraw) { __glXWindow *pGlxWindow; - dixLookupResourceByType((pointer *) &pGlxWindow, + dixLookupResourceByType((void **) &pGlxWindow, drawId, __glXWindowRes, NullClient, DixUnknownAccess); if (pGlxWindow) { @@ -3702,7 +3702,7 @@ __glXChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc) if (!pDraw) { __glXPbuffer *pGlxPbuffer; - dixLookupResourceByType((pointer *) &pGlxPbuffer, + dixLookupResourceByType((void **) &pGlxPbuffer, drawId, __glXPbufferRes, NullClient, DixUnknownAccess); if (pGlxPbuffer) { @@ -3731,7 +3731,7 @@ __glXChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc) if (!noPanoramiXExtension) { PanoramiXRes *pXinDraw; - if (Success != dixLookupResourceByClass((pointer *) &pXinDraw, + if (Success != dixLookupResourceByClass((void **) &pXinDraw, pDraw->id, XRC_DRAWABLE, client, DixReadAccess)) { client->errorValue = drawId; diff --git a/xorg-server/hw/dmx/glxProxy/glxext.c b/xorg-server/hw/dmx/glxProxy/glxext.c index b46970864..3c5a14bc7 100644 --- a/xorg-server/hw/dmx/glxProxy/glxext.c +++ b/xorg-server/hw/dmx/glxProxy/glxext.c @@ -182,7 +182,7 @@ __glXFreeGLXWindow(__glXWindow * pGlxWindow) WindowPtr pWindow = (WindowPtr) pGlxWindow->pDraw; WindowPtr ret; - dixLookupResourceByType((pointer) &ret, + dixLookupResourceByType((void *) &ret, pWindow->drawable.id, RT_WINDOW, NullClient, DixUnknownAccess); if (ret == pWindow) { @@ -414,7 +414,7 @@ __glXDispatch(ClientPtr client) */ XID xid = FakeClientID(client->index); - if (!AddResource(xid, __glXClientRes, (pointer) (long) client->index)) { + if (!AddResource(xid, __glXClientRes, (void *) (long) client->index)) { return BadAlloc; } ResetClientState(client->index); @@ -468,7 +468,7 @@ __glXSwapDispatch(ClientPtr client) */ XID xid = FakeClientID(client->index); - if (!AddResource(xid, __glXClientRes, (pointer) (long) client->index)) { + if (!AddResource(xid, __glXClientRes, (void *) (long) client->index)) { return BadAlloc; } ResetClientState(client->index); diff --git a/xorg-server/hw/dmx/glxProxy/glxswap.c b/xorg-server/hw/dmx/glxProxy/glxswap.c index 87a748621..5f565010d 100644 --- a/xorg-server/hw/dmx/glxProxy/glxswap.c +++ b/xorg-server/hw/dmx/glxProxy/glxswap.c @@ -110,7 +110,7 @@ SwapGroupIsReadyToSwap(SwapGroupPtr pSwap) } static Bool -SGSwapCleanup(ClientPtr client, pointer closure) +SGSwapCleanup(ClientPtr client, void *closure) { /* SwapGroupPtr pSwap = (SwapGroupPtr)closure; */ @@ -154,7 +154,7 @@ SGSwapBuffers(__GLXclientState * cl, XID drawId, GLXContextTag tag, else { /* The swap group/barrier is not yet ready to swap, so put * client to sleep until the rest are ready to swap */ - ClientSleep(cl->client, SGSwapCleanup, (pointer) pWin); + ClientSleep(cl->client, SGSwapCleanup, (void *) pWin); pCur->sleeping = TRUE; } diff --git a/xorg-server/hw/dmx/input/dmxbackend.c b/xorg-server/hw/dmx/input/dmxbackend.c index 807e02328..56abe8013 100644 --- a/xorg-server/hw/dmx/input/dmxbackend.c +++ b/xorg-server/hw/dmx/input/dmxbackend.c @@ -101,7 +101,7 @@ typedef struct _myPrivate { #endif /** Create and return a private data structure. */ -pointer +void * dmxBackendCreatePrivate(DeviceIntPtr pDevice) { GETDMXLOCALFROMPDEVICE; @@ -115,7 +115,7 @@ dmxBackendCreatePrivate(DeviceIntPtr pDevice) * verify that the structure was actually created by * #dmxBackendCreatePrivate. */ void -dmxBackendDestroyPrivate(pointer private) +dmxBackendDestroyPrivate(void *private) { free(private); } @@ -262,7 +262,7 @@ dmxBackendOffscreen(int screen, int x, int y) /** This routine is called from #dmxCoreMotion for each motion * event. \a x and \a y are global coordinants. */ void -dmxBackendUpdatePosition(pointer private, int x, int y) +dmxBackendUpdatePosition(void *private, int x, int y) { GETPRIVFROMPRIVATE; int screen = miPointerGetScreen(inputInfo.pointer)->myNum; @@ -500,7 +500,7 @@ dmxBackendCollectEvents(DevicePtr pDev, * event processing actually takes place here, but this is a convenient * place to update the pointer. */ void -dmxBackendProcessInput(pointer private) +dmxBackendProcessInput(void *private) { GETPRIVFROMPRIVATE; @@ -650,7 +650,7 @@ dmxBackendKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) /** Process #DMXFunctionType functions. The only function handled here * is to acknowledge a pending server shutdown. */ int -dmxBackendFunctions(pointer private, DMXFunctionType function) +dmxBackendFunctions(void *private, DMXFunctionType function) { switch (function) { case DMX_FUNCTION_TERMINATE: diff --git a/xorg-server/hw/dmx/input/dmxbackend.h b/xorg-server/hw/dmx/input/dmxbackend.h index 6a49a56d6..a60857369 100644 --- a/xorg-server/hw/dmx/input/dmxbackend.h +++ b/xorg-server/hw/dmx/input/dmxbackend.h @@ -38,8 +38,8 @@ #ifndef _DMXBACKEND_H_ #define _DMXBACKEND_H_ -extern pointer dmxBackendCreatePrivate(DeviceIntPtr pDevice); -extern void dmxBackendDestroyPrivate(pointer private); +extern void *dmxBackendCreatePrivate(DeviceIntPtr pDevice); +extern void dmxBackendDestroyPrivate(void *private); extern void dmxBackendInit(DevicePtr pDev); extern void dmxBackendLateReInit(DevicePtr pDev); extern void dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); @@ -49,8 +49,8 @@ extern void dmxBackendCollectEvents(DevicePtr pDev, dmxEnqueueProcPtr enqueue, dmxCheckSpecialProcPtr checkspecial, DMXBlockType block); -extern void dmxBackendProcessInput(pointer private); -extern int dmxBackendFunctions(pointer private, DMXFunctionType function); -extern void dmxBackendUpdatePosition(pointer private, int x, int y); +extern void dmxBackendProcessInput(void *private); +extern int dmxBackendFunctions(void *private, DMXFunctionType function); +extern void dmxBackendUpdatePosition(void *private, int x, int y); #endif diff --git a/xorg-server/hw/dmx/input/dmxcommon.c b/xorg-server/hw/dmx/input/dmxcommon.c index db558b55f..90154ef3e 100644 --- a/xorg-server/hw/dmx/input/dmxcommon.c +++ b/xorg-server/hw/dmx/input/dmxcommon.c @@ -339,7 +339,7 @@ dmxCommonOthOn(DevicePtr pDev) if (!(priv->xi = XOpenDevice(priv->display, dmxLocal->deviceId))) { dmxLog(dmxWarning, "Cannot open %s device (id=%d) on %s\n", dmxLocal->deviceName ? dmxLocal->deviceName : "(unknown)", - dmxLocal->deviceId, dmxInput->name); + (int) dmxLocal->deviceId, dmxInput->name); return -1; } ADD(DeviceKeyPress); @@ -558,7 +558,7 @@ dmxFindPointerScreen(int x, int y) * (e.g., when a keyboard and mouse form a pair that should share the * same private area). If the requested private area cannot be located, * then NULL is returned. */ -pointer +void * dmxCommonCopyPrivate(DeviceIntPtr pDevice) { GETDMXLOCALFROMPDEVICE; @@ -583,7 +583,7 @@ dmxCommonCopyPrivate(DeviceIntPtr pDevice) * server startup and server shutdown). */ void -dmxCommonSaveState(pointer private) +dmxCommonSaveState(void *private) { GETPRIVFROMPRIVATE; XKeyboardState ks; @@ -641,7 +641,7 @@ dmxCommonSaveState(pointer private) /** This routine restores all the information saved by #dmxCommonSaveState. */ void -dmxCommonRestoreState(pointer private) +dmxCommonRestoreState(void *private) { GETPRIVFROMPRIVATE; int retcode = -1; diff --git a/xorg-server/hw/dmx/input/dmxcommon.h b/xorg-server/hw/dmx/input/dmxcommon.h index d4f8d3c89..ed04287a5 100644 --- a/xorg-server/hw/dmx/input/dmxcommon.h +++ b/xorg-server/hw/dmx/input/dmxcommon.h @@ -118,7 +118,7 @@ extern void dmxCommonOthOff(DevicePtr pDev); extern void dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); /* helper functions */ -extern pointer dmxCommonCopyPrivate(DeviceIntPtr pDevice); -extern void dmxCommonSaveState(pointer private); -extern void dmxCommonRestoreState(pointer private); +extern void *dmxCommonCopyPrivate(DeviceIntPtr pDevice); +extern void dmxCommonSaveState(void *private); +extern void dmxCommonRestoreState(void *private); #endif diff --git a/xorg-server/hw/dmx/input/dmxconsole.c b/xorg-server/hw/dmx/input/dmxconsole.c index 600a70553..f33a0ebd3 100644 --- a/xorg-server/hw/dmx/input/dmxconsole.c +++ b/xorg-server/hw/dmx/input/dmxconsole.c @@ -141,7 +141,7 @@ unscaley(myPrivate * priv, int y) } /** Create the private area for \a pDevice. */ -pointer +void * dmxConsoleCreatePrivate(DeviceIntPtr pDevice) { GETDMXLOCALFROMPDEVICE; @@ -153,7 +153,7 @@ dmxConsoleCreatePrivate(DeviceIntPtr pDevice) /** If \a private is non-NULL, free its associated memory. */ void -dmxConsoleDestroyPrivate(pointer private) +dmxConsoleDestroyPrivate(void *private) { free(private); } @@ -193,7 +193,7 @@ dmxConsoleDrawFineCursor(myPrivate * priv, XRectangle * rect) } static void -dmxConsoleDrawWindows(pointer private) +dmxConsoleDrawWindows(void *private) { GETONLYPRIVFROMPRIVATE; Display *dpy = priv->display; @@ -391,7 +391,7 @@ dmxConsoleUpdateFineCursor(myPrivate * priv) * fashion: the actual layout of the windows of the screen might not * have had any human-visible changes. */ void -dmxConsoleUpdateInfo(pointer private, DMXUpdateType type, WindowPtr pWindow) +dmxConsoleUpdateInfo(void *private, DMXUpdateType type, WindowPtr pWindow) { GETONLYPRIVFROMPRIVATE; dmxConsoleDraw(priv, 1, 1); @@ -436,7 +436,7 @@ dmxConsoleMoveRelative(myPrivate * priv, int x, int y, * allows the console's notion of the cursor postion to change when * another input device actually caused the change. */ void -dmxConsoleUpdatePosition(pointer private, int x, int y) +dmxConsoleUpdatePosition(void *private, int x, int y) { GETONLYPRIVFROMPRIVATE; int tmpX, tmpY; @@ -825,8 +825,8 @@ dmxConsoleInit(DevicePtr pDev) /* Set up properties */ XStoreName(dpy, win, DMX_CONSOLE_NAME); - class_hints.res_name = DMX_RES_NAME; - class_hints.res_class = DMX_RES_CLASS; + class_hints.res_name = (char *) DMX_RES_NAME; + class_hints.res_class = (char *) DMX_RES_CLASS; XSetClassHint(dpy, win, &class_hints); /* Map the window */ @@ -941,7 +941,7 @@ dmxConsoleKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info) /** Handle special console-only keys. */ int -dmxConsoleFunctions(pointer private, DMXFunctionType function) +dmxConsoleFunctions(void *private, DMXFunctionType function) { GETONLYPRIVFROMPRIVATE; XRectangle rect; diff --git a/xorg-server/hw/dmx/input/dmxconsole.h b/xorg-server/hw/dmx/input/dmxconsole.h index 1c5261101..ea6033c3a 100644 --- a/xorg-server/hw/dmx/input/dmxconsole.h +++ b/xorg-server/hw/dmx/input/dmxconsole.h @@ -37,8 +37,8 @@ #ifndef _DMXCONSOLE_H_ #define _DMXCONSOLE_H_ -extern pointer dmxConsoleCreatePrivate(DeviceIntPtr pDevice); -extern void dmxConsoleDestroyPrivate(pointer private); +extern void *dmxConsoleCreatePrivate(DeviceIntPtr pDevice); +extern void dmxConsoleDestroyPrivate(void *private); extern void dmxConsoleInit(DevicePtr pDev); extern void dmxConsoleReInit(DevicePtr pDev); extern void dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); @@ -48,12 +48,12 @@ extern void dmxConsoleCollectEvents(DevicePtr pDev, dmxEnqueueProcPtr enqueue, dmxCheckSpecialProcPtr checkspecial, DMXBlockType block); -extern int dmxConsoleFunctions(pointer private, DMXFunctionType function); -extern void dmxConsoleUpdatePosition(pointer private, int x, int y); -extern void dmxConsoleKbdSetCtrl(pointer private, KeybdCtrl * ctrl); +extern int dmxConsoleFunctions(void *private, DMXFunctionType function); +extern void dmxConsoleUpdatePosition(void *private, int x, int y); +extern void dmxConsoleKbdSetCtrl(void *private, KeybdCtrl * ctrl); extern void dmxConsoleCapture(DMXInputInfo * dmxInput); extern void dmxConsoleUncapture(DMXInputInfo * dmxInput); -extern void dmxConsoleUpdateInfo(pointer private, +extern void dmxConsoleUpdateInfo(void *private, DMXUpdateType, WindowPtr pWindow); #endif diff --git a/xorg-server/hw/dmx/input/dmxevents.c b/xorg-server/hw/dmx/input/dmxevents.c index bcb5c2ed8..14ac05f5c 100644 --- a/xorg-server/hw/dmx/input/dmxevents.c +++ b/xorg-server/hw/dmx/input/dmxevents.c @@ -701,7 +701,6 @@ dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, XEvent * e, DMXBlockType block) { GETDMXINPUTFROMPDEV; - xEvent xE; DeviceIntPtr p = dmxLocal->pDevice; int valuators[3]; ValuatorMask mask; @@ -716,7 +715,7 @@ dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, if (dmxCheckFunctionKeys(dmxLocal, type, keySym)) return; if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard) - xE.u.u.detail = dmxFixup(pDev, detail, keySym); + detail = dmxFixup(pDev, detail, keySym); /*ErrorF("KEY %d sym %d\n", detail, (int) keySym); */ QueueKeyboardEvents(p, type, detail, NULL); diff --git a/xorg-server/hw/dmx/input/dmxinputinit.c b/xorg-server/hw/dmx/input/dmxinputinit.c index b22a41f56..abb6a8551 100644 --- a/xorg-server/hw/dmx/input/dmxinputinit.c +++ b/xorg-server/hw/dmx/input/dmxinputinit.c @@ -225,7 +225,7 @@ dmxKbdCtrl(DeviceIntPtr pDevice, KeybdCtrl * ctrl) /* taken from kdrive/src/kinput.c: */ static void -dmxBell(int volume, DeviceIntPtr pDev, pointer arg, int something) +dmxBell(int volume, DeviceIntPtr pDev, void *arg, int something) { #if 0 KeybdCtrl *ctrl = arg; @@ -336,7 +336,7 @@ _dmxKeyboardBellProc(DMXLocalInputInfoPtr dmxLocal, int percent) * sound the bell on all of the devices that send core events. */ void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice, - pointer ctrl, int unknown) + void *ctrl, int unknown) { GETDMXLOCALFROMPDEVICE; int i, j; @@ -633,7 +633,7 @@ dmxCollectAll(DMXInputInfo * dmxInput) } static void -dmxBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask) +dmxBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) { DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData]; static unsigned long generation = 0; @@ -645,7 +645,7 @@ dmxBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask) } static void -dmxSwitchReturn(pointer p) +dmxSwitchReturn(void *p) { DMXInputInfo *dmxInput = p; int i; @@ -662,7 +662,7 @@ dmxSwitchReturn(pointer p) } static void -dmxWakeupHandler(pointer blockData, int result, pointer pReadMask) +dmxWakeupHandler(void *blockData, int result, void *pReadMask) { DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData]; int i; @@ -921,7 +921,7 @@ dmxInputScanForExtensions(DMXInputInfo * dmxInput, int doXI) break; } dmxLogInput(dmxInput, " %2d %-10.10s %-16.16s\n", - devices[i].id, + (int) devices[i].id, devices[i].name ? devices[i].name : "", use); } @@ -993,7 +993,6 @@ dmxInputLateReInit(DMXInputInfo * dmxInput) void dmxInputInit(DMXInputInfo * dmxInput) { - DeviceIntPtr pPointer = NULL, pKeyboard = NULL; dmxArg a; const char *name; int i; @@ -1108,12 +1107,6 @@ dmxInputInit(DMXInputInfo * dmxInput) DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i]; dmxLocal->pDevice = dmxAddDevice(dmxLocal); - if (dmxLocal->isCore) { - if (dmxLocal->type == DMX_LOCAL_MOUSE) - pPointer = dmxLocal->pDevice; - if (dmxLocal->type == DMX_LOCAL_KEYBOARD) - pKeyboard = dmxLocal->pDevice; - } } dmxInput->processInputEvents = dmxProcessInputEvents; @@ -1136,7 +1129,7 @@ dmxInputFreeLocal(DMXLocalInputInfoRec * local) local->destroy_private(local->private); free(local->history); free(local->valuators); - free(local->deviceName); + free((void *) local->deviceName); local->private = NULL; local->history = NULL; local->deviceName = NULL; @@ -1164,7 +1157,7 @@ dmxInputFree(DMXInputInfo * dmxInput) dmxInput->devs = NULL; dmxInput->numDevs = 0; if (dmxInput->freename) - free(dmxInput->name); + free((void *) dmxInput->name); dmxInput->name = NULL; } @@ -1218,7 +1211,7 @@ dmxInputLogDevices(void) dmxLogCont(dmxInfo, "\t[i%d/%*.*s", dmxInput->inputIdx, len, len, dmxInput->name); if (dmxInput->devs[i]->deviceId >= 0) - dmxLogCont(dmxInfo, "/id%d", dmxInput->devs[i]->deviceId); + dmxLogCont(dmxInfo, "/id%d", (int) dmxInput->devs[i]->deviceId); if (dmxInput->devs[i]->deviceName) dmxLogCont(dmxInfo, "=%s", dmxInput->devs[i]->deviceName); dmxLogCont(dmxInfo, "] %s\n", diff --git a/xorg-server/hw/dmx/input/dmxinputinit.h b/xorg-server/hw/dmx/input/dmxinputinit.h index 94ec1019b..11af2ca82 100644 --- a/xorg-server/hw/dmx/input/dmxinputinit.h +++ b/xorg-server/hw/dmx/input/dmxinputinit.h @@ -127,8 +127,8 @@ typedef struct _DMXLocalInitInfo { KeySym *symbols; /**< Key symbols */ } DMXLocalInitInfo, *DMXLocalInitInfoPtr; -typedef pointer (*dmxCreatePrivateProcPtr) (DeviceIntPtr); -typedef void (*dmxDestroyPrivateProcPtr) (pointer); +typedef void *(*dmxCreatePrivateProcPtr) (DeviceIntPtr); +typedef void (*dmxDestroyPrivateProcPtr) (void *); typedef void (*dmxInitProcPtr) (DevicePtr); typedef void (*dmxReInitProcPtr) (DevicePtr); @@ -136,13 +136,13 @@ typedef void (*dmxLateReInitProcPtr) (DevicePtr); typedef void (*dmxGetInfoProcPtr) (DevicePtr, DMXLocalInitInfoPtr); typedef int (*dmxOnProcPtr) (DevicePtr); typedef void (*dmxOffProcPtr) (DevicePtr); -typedef void (*dmxUpdatePositionProcPtr) (pointer, int x, int y); +typedef void (*dmxUpdatePositionProcPtr) (void *, int x, int y); -typedef void (*dmxVTPreSwitchProcPtr) (pointer); /* Turn I/O Off */ -typedef void (*dmxVTPostSwitchProcPtr) (pointer); /* Turn I/O On */ -typedef void (*dmxVTSwitchReturnProcPtr) (pointer); -typedef int (*dmxVTSwitchProcPtr) (pointer, int vt, - dmxVTSwitchReturnProcPtr, pointer); +typedef void (*dmxVTPreSwitchProcPtr) (void *); /* Turn I/O Off */ +typedef void (*dmxVTPostSwitchProcPtr) (void *); /* Turn I/O On */ +typedef void (*dmxVTSwitchReturnProcPtr) (void *); +typedef int (*dmxVTSwitchProcPtr) (void *, int vt, + dmxVTSwitchReturnProcPtr, void *); typedef void (*dmxMotionProcPtr) (DevicePtr, int *valuators, @@ -157,9 +157,9 @@ typedef void (*dmxCollectEventsProcPtr) (DevicePtr, dmxMotionProcPtr, dmxEnqueueProcPtr, dmxCheckSpecialProcPtr, DMXBlockType); -typedef void (*dmxProcessInputProcPtr) (pointer); -typedef void (*dmxUpdateInfoProcPtr) (pointer, DMXUpdateType, WindowPtr); -typedef int (*dmxFunctionsProcPtr) (pointer, DMXFunctionType); +typedef void (*dmxProcessInputProcPtr) (void *); +typedef void (*dmxUpdateInfoProcPtr) (void *, DMXUpdateType, WindowPtr); +typedef int (*dmxFunctionsProcPtr) (void *, DMXFunctionType); typedef void (*dmxKBCtrlProcPtr) (DevicePtr, KeybdCtrl * ctrl); typedef void (*dmxMCtrlProcPtr) (DevicePtr, PtrCtrl * ctrl); @@ -223,7 +223,7 @@ typedef struct _DMXLocalInputInfo { dmxKBCtrlProcPtr kCtrl; /**< Keyboard control */ dmxKBBellProcPtr kBell; /**< Bell control */ - pointer private; /**< Device-dependent private */ + void *private; /**< Device-dependent private */ int isCore; /**< Is a DMX core device */ int sendsCore; /**< Sends DMX core events */ KeybdCtrl kctrl; /**< Keyboard control */ @@ -269,7 +269,7 @@ extern DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo * dmxInput, extern void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl * ctrl); extern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl * ctrl); extern void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice, - pointer ctrl, int unknown); + void *ctrl, int unknown); extern int dmxInputExtensionErrorHandler(Display * dsp, _Xconst char *name, _Xconst char *reason); diff --git a/xorg-server/hw/dmx/input/lnx-keyboard.c b/xorg-server/hw/dmx/input/lnx-keyboard.c index ecf4f591c..1a4d01f36 100644 --- a/xorg-server/hw/dmx/input/lnx-keyboard.c +++ b/xorg-server/hw/dmx/input/lnx-keyboard.c @@ -361,7 +361,7 @@ static unsigned char at2lnx[NUM_KEYCODES] = { }; /** Create a private structure for use within this file. */ -pointer +void * kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard) { myPrivate *priv = calloc(1, sizeof(*priv)); @@ -373,7 +373,7 @@ kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard) /** Destroy a private structure. */ void -kbdLinuxDestroyPrivate(pointer priv) +kbdLinuxDestroyPrivate(void *priv) { free(priv); } @@ -466,13 +466,13 @@ static int kbdLinuxActivate(int fd, int vtno, int setSig); /** Currently unused hook called prior to an VT switch. */ void -kbdLinuxVTPreSwitch(pointer p) +kbdLinuxVTPreSwitch(void *p) { } /** Currently unused hook called after returning from a VT switch. */ void -kbdLinuxVTPostSwitch(pointer p) +kbdLinuxVTPostSwitch(void *p) { } @@ -481,8 +481,8 @@ kbdLinuxVTPostSwitch(pointer p) * switched back to the pre-switch VT (i.e., the user returns to the DMX * session). */ int -kbdLinuxVTSwitch(pointer p, int vt, - void (*switch_return) (pointer), pointer switch_return_data) +kbdLinuxVTSwitch(void *p, int vt, + void (*switch_return) (void *), void *switch_return_data) { myPrivate *priv = p; diff --git a/xorg-server/hw/dmx/input/lnx-keyboard.h b/xorg-server/hw/dmx/input/lnx-keyboard.h index 891c6a9a4..857ea11b1 100644 --- a/xorg-server/hw/dmx/input/lnx-keyboard.h +++ b/xorg-server/hw/dmx/input/lnx-keyboard.h @@ -37,19 +37,19 @@ #ifndef _LNX_KEYBOARD_H_ #define _LNX_KEYBOARD_H_ -extern pointer kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard); -extern void kbdLinuxDestroyPrivate(pointer private); +extern void *kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard); +extern void kbdLinuxDestroyPrivate(void *private); extern void kbdLinuxInit(DevicePtr pDev); extern void kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); extern int kbdLinuxOn(DevicePtr pDev); extern void kbdLinuxOff(DevicePtr pDev); -extern void kbdLinuxVTPreSwitch(pointer p); -extern void kbdLinuxVTPostSwitch(pointer p); -extern int kbdLinuxVTSwitch(pointer p, int vt, +extern void kbdLinuxVTPreSwitch(void *p); +extern void kbdLinuxVTPostSwitch(void *p); +extern int kbdLinuxVTSwitch(void *p, int vt, dmxVTSwitchReturnProcPtr switch_return, - pointer switch_return_data); + void *switch_return_data); extern void kbdLinuxRead(DevicePtr pDev, dmxMotionProcPtr motion, diff --git a/xorg-server/hw/dmx/input/lnx-ms.c b/xorg-server/hw/dmx/input/lnx-ms.c index 7e1acf450..210f6de22 100644 --- a/xorg-server/hw/dmx/input/lnx-ms.c +++ b/xorg-server/hw/dmx/input/lnx-ms.c @@ -302,18 +302,18 @@ msLinuxGetMap(DevicePtr pDev, unsigned char *map, int *nButtons) /** Currently unused hook called prior to an VT switch. */ void -msLinuxVTPreSwitch(pointer p) +msLinuxVTPreSwitch(void *p) { } /** Currently unused hook called after returning from a VT switch. */ void -msLinuxVTPostSwitch(pointer p) +msLinuxVTPostSwitch(void *p) { } /** Create a private structure for use within this file. */ -pointer +void * msLinuxCreatePrivate(DeviceIntPtr pMouse) { myPrivate *priv = calloc(1, sizeof(*priv)); @@ -325,7 +325,7 @@ msLinuxCreatePrivate(DeviceIntPtr pMouse) /** Destroy a private structure. */ void -msLinuxDestroyPrivate(pointer priv) +msLinuxDestroyPrivate(void *priv) { free(priv); } diff --git a/xorg-server/hw/dmx/input/lnx-ms.h b/xorg-server/hw/dmx/input/lnx-ms.h index 28ed09557..7f3ba4ead 100644 --- a/xorg-server/hw/dmx/input/lnx-ms.h +++ b/xorg-server/hw/dmx/input/lnx-ms.h @@ -37,8 +37,8 @@ #ifndef _LNX_MS_H_ #define _LNX_MS_H_ -extern pointer msLinuxCreatePrivate(DeviceIntPtr pMouse); -extern void msLinuxDestroyPrivate(pointer priv); +extern void *msLinuxCreatePrivate(DeviceIntPtr pMouse); +extern void msLinuxDestroyPrivate(void *priv); extern void msLinuxRead(DevicePtr pDev, dmxMotionProcPtr motion, dmxEnqueueProcPtr enqueue, @@ -49,7 +49,7 @@ extern void msLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); extern int msLinuxOn(DevicePtr pDev); extern void msLinuxOff(DevicePtr pDev); extern void msLinuxCtrl(DevicePtr pDev, PtrCtrl * ctrl); -extern void msLinuxVTPreSwitch(pointer p); -extern void msLinuxVTPostSwitch(pointer p); +extern void msLinuxVTPreSwitch(void *p); +extern void msLinuxVTPostSwitch(void *p); #endif diff --git a/xorg-server/hw/dmx/input/lnx-ps2.c b/xorg-server/hw/dmx/input/lnx-ps2.c index 67c73a0c5..dd70cb8ea 100644 --- a/xorg-server/hw/dmx/input/lnx-ps2.c +++ b/xorg-server/hw/dmx/input/lnx-ps2.c @@ -272,18 +272,18 @@ ps2LinuxGetMap(DevicePtr pDev, unsigned char *map, int *nButtons) /** Currently unused hook called prior to an VT switch. */ void -ps2LinuxVTPreSwitch(pointer p) +ps2LinuxVTPreSwitch(void *p) { } /** Currently unused hook called after returning from a VT switch. */ void -ps2LinuxVTPostSwitch(pointer p) +ps2LinuxVTPostSwitch(void *p) { } /** Create a private structure for use within this file. */ -pointer +void * ps2LinuxCreatePrivate(DeviceIntPtr pMouse) { myPrivate *priv = calloc(1, sizeof(*priv)); @@ -295,7 +295,7 @@ ps2LinuxCreatePrivate(DeviceIntPtr pMouse) /** Destroy a private structure. */ void -ps2LinuxDestroyPrivate(pointer priv) +ps2LinuxDestroyPrivate(void *priv) { free(priv); } diff --git a/xorg-server/hw/dmx/input/lnx-ps2.h b/xorg-server/hw/dmx/input/lnx-ps2.h index 93f0f0219..339f3538c 100644 --- a/xorg-server/hw/dmx/input/lnx-ps2.h +++ b/xorg-server/hw/dmx/input/lnx-ps2.h @@ -37,8 +37,8 @@ #ifndef _LNX_PS2_H_ #define _LNX_PS2_H_ -extern pointer ps2LinuxCreatePrivate(DeviceIntPtr pMouse); -extern void ps2LinuxDestroyPrivate(pointer priv); +extern void *ps2LinuxCreatePrivate(DeviceIntPtr pMouse); +extern void ps2LinuxDestroyPrivate(void *priv); extern void ps2LinuxRead(DevicePtr pDev, dmxMotionProcPtr motion, dmxEnqueueProcPtr enqueue, @@ -49,7 +49,7 @@ extern void ps2LinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info); extern int ps2LinuxOn(DevicePtr pDev); extern void ps2LinuxOff(DevicePtr pDev); extern void ps2LinuxCtrl(DevicePtr pDev, PtrCtrl * ctrl); -extern void ps2LinuxVTPreSwitch(pointer p); -extern void ps2LinuxVTPostSwitch(pointer p); +extern void ps2LinuxVTPreSwitch(void *p); +extern void ps2LinuxVTPostSwitch(void *p); #endif diff --git a/xorg-server/hw/dmx/input/usb-common.c b/xorg-server/hw/dmx/input/usb-common.c index c7c166cce..67aa07e0a 100644 --- a/xorg-server/hw/dmx/input/usb-common.c +++ b/xorg-server/hw/dmx/input/usb-common.c @@ -474,7 +474,7 @@ usbOff(DevicePtr pDev) } /** Create a private structure for use within this file. */ -pointer +void * usbCreatePrivate(DeviceIntPtr pDevice) { myPrivate *priv = calloc(1, sizeof(*priv)); @@ -486,7 +486,7 @@ usbCreatePrivate(DeviceIntPtr pDevice) /** Destroy a private structure. */ void -usbDestroyPrivate(pointer priv) +usbDestroyPrivate(void *priv) { free(priv); } diff --git a/xorg-server/hw/dmx/input/usb-common.h b/xorg-server/hw/dmx/input/usb-common.h index eea98afbe..71593765f 100644 --- a/xorg-server/hw/dmx/input/usb-common.h +++ b/xorg-server/hw/dmx/input/usb-common.h @@ -43,8 +43,8 @@ typedef enum { usbOther } usbType; -extern pointer usbCreatePrivate(DeviceIntPtr pDevice); -extern void usbDestroyPrivate(pointer priv); +extern void *usbCreatePrivate(DeviceIntPtr pDevice); +extern void usbDestroyPrivate(void *priv); extern void usbRead(DevicePtr pDev, dmxMotionProcPtr motion, dmxEnqueueProcPtr enqueue, diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c index ac988b2bc..6cf007602 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyr.c +++ b/xorg-server/hw/kdrive/ephyr/ephyr.c @@ -344,7 +344,7 @@ ephyrInternalDamageRedisplay(ScreenPtr pScreen) } static void -ephyrInternalDamageBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead) +ephyrInternalDamageBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) { ScreenPtr pScreen = (ScreenPtr) data; @@ -352,7 +352,7 @@ ephyrInternalDamageBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead) } static void -ephyrInternalDamageWakeupHandler(pointer data, int i, pointer LastSelectMask) +ephyrInternalDamageWakeupHandler(void *data, int i, void *LastSelectMask) { /* FIXME: Not needed ? */ } @@ -371,7 +371,7 @@ ephyrSetInternalDamage(ScreenPtr pScreen) if (!RegisterBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, ephyrInternalDamageWakeupHandler, - (pointer) pScreen)) + (void *) pScreen)) return FALSE; pPixmap = (*pScreen->GetScreenPixmap) (pScreen); @@ -392,7 +392,7 @@ ephyrUnsetInternalDamage(ScreenPtr pScreen) RemoveBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, ephyrInternalDamageWakeupHandler, - (pointer) pScreen); + (void *) pScreen); } #ifdef RANDR diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c index 218e3b00c..20e8033a9 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c +++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c @@ -150,8 +150,6 @@ ddxUseMsg(void) ErrorF ("-title [title] set the window title in the WM_NAME property\n"); ErrorF("\n"); - - exit(1); } #endif diff --git a/xorg-server/hw/kdrive/ephyr/ephyrvideo.c b/xorg-server/hw/kdrive/ephyr/ephyrvideo.c index 4a05721af..c6728351f 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrvideo.c +++ b/xorg-server/hw/kdrive/ephyr/ephyrvideo.c @@ -84,15 +84,15 @@ static Bool ephyrXVPrivSaveImageToPortPriv(EphyrPortPriv * a_port_priv, int a_image_len); static void ephyrStopVideo(KdScreenInfo * a_info, - pointer a_xv_priv, Bool a_exit); + void *a_xv_priv, Bool a_exit); static int ephyrSetPortAttribute(KdScreenInfo * a_info, Atom a_attr_name, - int a_attr_value, pointer a_port_priv); + int a_attr_value, void *a_port_priv); static int ephyrGetPortAttribute(KdScreenInfo * a_screen_info, Atom a_attr_name, - int *a_attr_value, pointer a_port_priv); + int *a_attr_value, void *a_port_priv); static void ephyrQueryBestSize(KdScreenInfo * a_info, Bool a_motion, @@ -101,7 +101,7 @@ static void ephyrQueryBestSize(KdScreenInfo * a_info, short a_drw_w, short a_drw_h, unsigned int *a_prefered_w, - unsigned int *a_prefered_h, pointer a_port_priv); + unsigned int *a_prefered_h, void *a_port_priv); static int ephyrPutImage(KdScreenInfo * a_info, DrawablePtr a_drawable, @@ -118,13 +118,13 @@ static int ephyrPutImage(KdScreenInfo * a_info, short a_width, short a_height, Bool a_sync, - RegionPtr a_clipping_region, pointer a_port_priv); + RegionPtr a_clipping_region, void *a_port_priv); static int ephyrReputImage(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_drw_x, short a_drw_y, - RegionPtr a_clipping_region, pointer a_port_priv); + RegionPtr a_clipping_region, void *a_port_priv); static int ephyrPutVideo(KdScreenInfo * a_info, DrawablePtr a_drawable, @@ -132,7 +132,7 @@ static int ephyrPutVideo(KdScreenInfo * a_info, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, - RegionPtr a_clip_region, pointer a_port_priv); + RegionPtr a_clip_region, void *a_port_priv); static int ephyrGetVideo(KdScreenInfo * a_info, DrawablePtr a_drawable, @@ -140,7 +140,7 @@ static int ephyrGetVideo(KdScreenInfo * a_info, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, - RegionPtr a_clip_region, pointer a_port_priv); + RegionPtr a_clip_region, void *a_port_priv); static int ephyrPutStill(KdScreenInfo * a_info, DrawablePtr a_drawable, @@ -148,7 +148,7 @@ static int ephyrPutStill(KdScreenInfo * a_info, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, - RegionPtr a_clip_region, pointer a_port_priv); + RegionPtr a_clip_region, void *a_port_priv); static int ephyrGetStill(KdScreenInfo * a_info, DrawablePtr a_drawable, @@ -156,7 +156,7 @@ static int ephyrGetStill(KdScreenInfo * a_info, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, - RegionPtr a_clip_region, pointer a_port_priv); + RegionPtr a_clip_region, void *a_port_priv); static int ephyrQueryImageAttributes(KdScreenInfo * a_info, int a_id, @@ -744,7 +744,7 @@ ephyrXVPrivSaveImageToPortPriv(EphyrPortPriv * a_port_priv, } static void -ephyrStopVideo(KdScreenInfo * a_info, pointer a_port_priv, Bool a_exit) +ephyrStopVideo(KdScreenInfo * a_info, void *a_port_priv, Bool a_exit) { xcb_connection_t *conn = hostx_get_xcbconn(); EphyrPortPriv *port_priv = a_port_priv; @@ -759,7 +759,7 @@ ephyrStopVideo(KdScreenInfo * a_info, pointer a_port_priv, Bool a_exit) static int ephyrSetPortAttribute(KdScreenInfo * a_info, - Atom a_attr_name, int a_attr_value, pointer a_port_priv) + Atom a_attr_name, int a_attr_value, void *a_port_priv) { xcb_connection_t *conn = hostx_get_xcbconn(); int res = Success, host_atom = 0; @@ -814,7 +814,7 @@ ephyrSetPortAttribute(KdScreenInfo * a_info, static int ephyrGetPortAttribute(KdScreenInfo * a_screen_info, - Atom a_attr_name, int *a_attr_value, pointer a_port_priv) + Atom a_attr_name, int *a_attr_value, void *a_port_priv) { xcb_connection_t *conn = hostx_get_xcbconn(); int res = Success, host_atom = 0; @@ -862,7 +862,7 @@ ephyrQueryBestSize(KdScreenInfo * a_info, short a_drw_w, short a_drw_h, unsigned int *a_prefered_w, - unsigned int *a_prefered_h, pointer a_port_priv) + unsigned int *a_prefered_h, void *a_port_priv) { xcb_connection_t *conn = hostx_get_xcbconn(); EphyrPortPriv *port_priv = a_port_priv; @@ -992,7 +992,7 @@ ephyrPutImage(KdScreenInfo * a_info, unsigned char *a_buf, short a_width, short a_height, - Bool a_sync, RegionPtr a_clipping_region, pointer a_port_priv) + Bool a_sync, RegionPtr a_clipping_region, void *a_port_priv) { EphyrPortPriv *port_priv = a_port_priv; Bool is_ok = FALSE; @@ -1064,7 +1064,7 @@ static int ephyrReputImage(KdScreenInfo * a_info, DrawablePtr a_drawable, short a_drw_x, - short a_drw_y, RegionPtr a_clipping_region, pointer a_port_priv) + short a_drw_y, RegionPtr a_clipping_region, void *a_port_priv) { EphyrPortPriv *port_priv = a_port_priv; int result = BadImplementation; @@ -1107,7 +1107,7 @@ ephyrPutVideo(KdScreenInfo * a_info, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, - RegionPtr a_clipping_region, pointer a_port_priv) + RegionPtr a_clipping_region, void *a_port_priv) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); @@ -1138,7 +1138,7 @@ ephyrGetVideo(KdScreenInfo * a_info, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, - RegionPtr a_clipping_region, pointer a_port_priv) + RegionPtr a_clipping_region, void *a_port_priv) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); @@ -1170,7 +1170,7 @@ ephyrPutStill(KdScreenInfo * a_info, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, - RegionPtr a_clipping_region, pointer a_port_priv) + RegionPtr a_clipping_region, void *a_port_priv) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); @@ -1201,7 +1201,7 @@ ephyrGetStill(KdScreenInfo * a_info, short a_drw_x, short a_drw_y, short a_vid_w, short a_vid_h, short a_drw_w, short a_drw_h, - RegionPtr a_clipping_region, pointer a_port_priv) + RegionPtr a_clipping_region, void *a_port_priv) { EphyrScrPriv *scrpriv = a_info->driver; xcb_connection_t *conn = hostx_get_xcbconn(); diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c index 873033373..dcf7af006 100644 --- a/xorg-server/hw/kdrive/ephyr/hostx.c +++ b/xorg-server/hw/kdrive/ephyr/hostx.c @@ -87,8 +87,6 @@ static int HostXWantDamageDebug = 0; extern EphyrKeySyms ephyrKeySyms; -extern int monitorResolution; - extern Bool EphyrWantResize; char *ephyrResName = NULL; diff --git a/xorg-server/hw/kdrive/linux/linux.c b/xorg-server/hw/kdrive/linux/linux.c index 00de2ae0e..6284de576 100644 --- a/xorg-server/hw/kdrive/linux/linux.c +++ b/xorg-server/hw/kdrive/linux/linux.c @@ -167,14 +167,14 @@ LinuxSetSwitchMode(int mode) } static void -LinuxApmBlock(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) +LinuxApmBlock(void *blockData, OSTimePtr pTimeout, void *pReadmask) { } static Bool LinuxApmRunning; static void -LinuxApmWakeup(pointer blockData, int result, pointer pReadmask) +LinuxApmWakeup(void *blockData, int result, void *pReadmask) { fd_set *readmask = (fd_set *) pReadmask; diff --git a/xorg-server/hw/kdrive/src/kcmap.c b/xorg-server/hw/kdrive/src/kcmap.c index c93c2f4d3..0970064f6 100644 --- a/xorg-server/hw/kdrive/src/kcmap.c +++ b/xorg-server/hw/kdrive/src/kcmap.c @@ -138,7 +138,7 @@ KdInstallColormap(ColormapPtr pCmap) /* Tell X clients that the installed colormap is going away. */ if (pScreenPriv->pInstalledmap) WalkTree(pScreenPriv->pInstalledmap->pScreen, TellLostMap, - (pointer) &(pScreenPriv->pInstalledmap->mid)); + (void *) &(pScreenPriv->pInstalledmap->mid)); /* Take note of the new installed colorscreen-> */ pScreenPriv->pInstalledmap = pCmap; @@ -146,7 +146,7 @@ KdInstallColormap(ColormapPtr pCmap) KdSetColormap(pCmap->pScreen); /* Tell X clients of the new colormap */ - WalkTree(pCmap->pScreen, TellGainedMap, (pointer) &(pCmap->mid)); + WalkTree(pCmap->pScreen, TellGainedMap, (void *) &(pCmap->mid)); } /* @@ -173,13 +173,13 @@ KdUninstallColormap(ColormapPtr pCmap) return; /* install default */ - dixLookupResourceByType((pointer *) &defMap, defMapID, RT_COLORMAP, + dixLookupResourceByType((void **) &defMap, defMapID, RT_COLORMAP, serverClient, DixInstallAccess); if (defMap) (*pCmap->pScreen->InstallColormap) (defMap); else { /* uninstall and clear colormap pointer */ - WalkTree(pCmap->pScreen, TellLostMap, (pointer) &(pCmap->mid)); + WalkTree(pCmap->pScreen, TellLostMap, (void *) &(pCmap->mid)); pScreenPriv->pInstalledmap = 0; } } diff --git a/xorg-server/hw/kdrive/src/kdrive.c b/xorg-server/hw/kdrive/src/kdrive.c index d56ba8fc5..d55bcd0d4 100644 --- a/xorg-server/hw/kdrive/src/kdrive.c +++ b/xorg-server/hw/kdrive/src/kdrive.c @@ -667,7 +667,7 @@ KdCloseScreen(ScreenPtr pScreen) pScreenPriv->screen->pScreen = 0; - free((pointer) pScreenPriv); + free((void *) pScreenPriv); return ret; } diff --git a/xorg-server/hw/kdrive/src/kdrive.h b/xorg-server/hw/kdrive/src/kdrive.h index f52072003..5b2f3378b 100644 --- a/xorg-server/hw/kdrive/src/kdrive.h +++ b/xorg-server/hw/kdrive/src/kdrive.h @@ -526,11 +526,11 @@ void KdSetLed(KdKeyboardInfo * ki, int led, Bool on); void - KdSetPointerMatrix(KdPointerMatrix * pointer); + KdSetPointerMatrix(KdPointerMatrix *pointer); void -KdComputePointerMatrix(KdPointerMatrix * pointer, Rotation randr, int width, +KdComputePointerMatrix(KdPointerMatrix *pointer, Rotation randr, int width, int height); void @@ -538,11 +538,11 @@ void void -KdBlockHandler(ScreenPtr pScreen, pointer timeout, pointer readmask); +KdBlockHandler(ScreenPtr pScreen, void *timeout, void *readmask); void -KdWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer readmask); +KdWakeupHandler(ScreenPtr pScreen, unsigned long result, void *readmask); void KdDisableInput(void); diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c index d5171a7f7..9ecd73013 100644 --- a/xorg-server/hw/kdrive/src/kinput.c +++ b/xorg-server/hw/kdrive/src/kinput.c @@ -555,7 +555,7 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) #endif static void -KdBell(int volume, DeviceIntPtr pDev, pointer arg, int something) +KdBell(int volume, DeviceIntPtr pDev, void *arg, int something) { KeybdCtrl *ctrl = arg; KdKeyboardInfo *ki = NULL; @@ -1963,7 +1963,7 @@ _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, } void -KdBlockHandler(ScreenPtr pScreen, pointer timeout, pointer readmask) +KdBlockHandler(ScreenPtr pScreen, void *timeout, void *readmask) { KdPointerInfo *pi; int myTimeout = 0; @@ -1989,7 +1989,7 @@ KdBlockHandler(ScreenPtr pScreen, pointer timeout, pointer readmask) } void -KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, pointer readmask) +KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, void *readmask) { int result = (int) lresult; fd_set *pReadmask = (fd_set *) readmask; diff --git a/xorg-server/hw/kdrive/src/kxv.c b/xorg-server/hw/kdrive/src/kxv.c index 22639728d..9e76eadf0 100644 --- a/xorg-server/hw/kdrive/src/kxv.c +++ b/xorg-server/hw/kdrive/src/kxv.c @@ -208,7 +208,7 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * adaptors, int num) sure that I appreciate that. */ ScreenPriv = malloc(sizeof(KdXVScreenRec)); - pxvs->devPriv.ptr = (pointer) ScreenPriv; + pxvs->devPriv.ptr = (void *) ScreenPriv; if (!ScreenPriv) return FALSE; @@ -487,7 +487,7 @@ KdXVInitAdaptors(ScreenPtr pScreen, KdVideoAdaptorPtr * infoPtr, int number) adaptorPriv->PutImage = adaptorPtr->PutImage; adaptorPriv->ReputImage = adaptorPtr->ReputImage; - pa->devPriv.ptr = (pointer) adaptorPriv; + pa->devPriv.ptr = (void *) adaptorPriv; if (!(pPort = calloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { KdXVFreeAdaptor(pa); @@ -874,7 +874,7 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv) } static int -KdXVReputAllVideo(WindowPtr pWin, pointer data) +KdXVReputAllVideo(WindowPtr pWin, void *data) { KdXVWindowPtr WinPriv; diff --git a/xorg-server/hw/kdrive/src/kxv.h b/xorg-server/hw/kdrive/src/kxv.h index 29118bc96..4f644c246 100644 --- a/xorg-server/hw/kdrive/src/kxv.h +++ b/xorg-server/hw/kdrive/src/kxv.h @@ -98,41 +98,41 @@ typedef int (*PutVideoFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, - pointer data); + void *data); typedef int (*PutStillFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, - pointer data); + void *data); typedef int (*GetVideoFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, - pointer data); + void *data); typedef int (*GetStillFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, - pointer data); -typedef void (*StopVideoFuncPtr) (KdScreenInfo * screen, pointer data, + void *data); +typedef void (*StopVideoFuncPtr) (KdScreenInfo * screen, void *data, Bool Exit); typedef int (*SetPortAttributeFuncPtr) (KdScreenInfo * screen, Atom attribute, - int value, pointer data); + int value, void *data); typedef int (*GetPortAttributeFuncPtr) (KdScreenInfo * screen, Atom attribute, - int *value, pointer data); + int *value, void *data); typedef void (*QueryBestSizeFuncPtr) (KdScreenInfo * screen, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, - unsigned int *p_h, pointer data); + unsigned int *p_h, void *data); typedef int (*PutImageFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int image, unsigned char *buf, short width, short height, - Bool Sync, RegionPtr clipBoxes, pointer data); + Bool Sync, RegionPtr clipBoxes, void *data); typedef int (*ReputImageFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, short drw_x, short drw_y, RegionPtr clipBoxes, - pointer data); + void *data); typedef int (*QueryImageAttributesFuncPtr) (KdScreenInfo * screen, int image, unsigned short *width, unsigned short *height, diff --git a/xorg-server/hw/vfb/InitOutput.c b/xorg-server/hw/vfb/InitOutput.c index 97eccfd4e..d10272244 100644 --- a/xorg-server/hw/vfb/InitOutput.c +++ b/xorg-server/hw/vfb/InitOutput.c @@ -404,7 +404,6 @@ vfbInstallColormap(ColormapPtr pmap) if (pmap != oldpmap) { int entries; XWDFileHeader *pXWDHeader; - XWDColor *pXWDCmap; VisualPtr pVisual; Pixel *ppix; xrgb *prgb; @@ -419,7 +418,6 @@ vfbInstallColormap(ColormapPtr pmap) entries = pmap->pVisual->ColormapEntries; pXWDHeader = vfbScreens[pmap->pScreen->myNum].pXWDHeader; - pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap; pVisual = pmap->pVisual; swapcopy32(pXWDHeader->visual_class, pVisual->class); @@ -460,7 +458,7 @@ vfbUninstallColormap(ColormapPtr pmap) if (pmap == curpmap) { if (pmap->mid != pmap->pScreen->defColormap) { - dixLookupResourceByType((pointer *) &curpmap, + dixLookupResourceByType((void **) &curpmap, pmap->pScreen->defColormap, RT_COLORMAP, serverClient, DixInstallAccess); @@ -508,7 +506,7 @@ vfbSaveScreen(ScreenPtr pScreen, int on) /* this flushes any changes to the screens out to the mmapped file */ static void -vfbBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) +vfbBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) { int i; @@ -529,7 +527,7 @@ vfbBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) } static void -vfbWakeupHandler(pointer blockData, int result, pointer pReadmask) +vfbWakeupHandler(void *blockData, int result, void *pReadmask) { } diff --git a/xorg-server/hw/xfree86/Makefile.am b/xorg-server/hw/xfree86/Makefile.am index 15670d01d..96729043d 100644 --- a/xorg-server/hw/xfree86/Makefile.am +++ b/xorg-server/hw/xfree86/Makefile.am @@ -121,7 +121,7 @@ sdksyms.dep sdksyms.c: sdksyms.sh $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) SDKSYMS_DEP = sdksyms.dep -include $(SDKSYMS_DEP) +-include $(SDKSYMS_DEP) i2c/libi2c.la: $(AM_V_at)cd i2c && $(MAKE) libi2c.la diff --git a/xorg-server/hw/xfree86/common/dgaproc.h b/xorg-server/hw/xfree86/common/dgaproc.h index e824d3094..87e923f26 100644 --- a/xorg-server/hw/xfree86/common/dgaproc.h +++ b/xorg-server/hw/xfree86/common/dgaproc.h @@ -24,7 +24,7 @@ typedef struct { int num; /* A unique identifier for the mode (num > 0) */ - char *name; /* name of mode given in the XF86Config */ + const char *name; /* name of mode given in the XF86Config */ int VSync_num; int VSync_den; int flags; /* DGA_CONCURRENT_ACCESS, etc... */ diff --git a/xorg-server/hw/xfree86/common/vidmodeproc.h b/xorg-server/hw/xfree86/common/vidmodeproc.h index 311d35c7b..cff340c47 100644 --- a/xorg-server/hw/xfree86/common/vidmodeproc.h +++ b/xorg-server/hw/xfree86/common/vidmodeproc.h @@ -34,7 +34,7 @@ typedef enum { } VidModeSelectMonitor; typedef union { - pointer ptr; + const void *ptr; int i; float f; } vidMonitorValue; @@ -42,38 +42,38 @@ typedef union { extern Bool VidModeExtensionInit(ScreenPtr pScreen); extern _X_EXPORT Bool VidModeAvailable(int scrnIndex); -extern _X_EXPORT Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode, +extern _X_EXPORT Bool VidModeGetCurrentModeline(int scrnIndex, void **mode, int *dotClock); -extern _X_EXPORT Bool VidModeGetFirstModeline(int scrnIndex, pointer *mode, +extern _X_EXPORT Bool VidModeGetFirstModeline(int scrnIndex, void **mode, int *dotClock); -extern _X_EXPORT Bool VidModeGetNextModeline(int scrnIndex, pointer *mode, +extern _X_EXPORT Bool VidModeGetNextModeline(int scrnIndex, void **mode, int *dotClock); -extern _X_EXPORT Bool VidModeDeleteModeline(int scrnIndex, pointer mode); +extern _X_EXPORT Bool VidModeDeleteModeline(int scrnIndex, void *mode); extern _X_EXPORT Bool VidModeZoomViewport(int scrnIndex, int zoom); extern _X_EXPORT Bool VidModeGetViewPort(int scrnIndex, int *x, int *y); extern _X_EXPORT Bool VidModeSetViewPort(int scrnIndex, int x, int y); -extern _X_EXPORT Bool VidModeSwitchMode(int scrnIndex, pointer mode); +extern _X_EXPORT Bool VidModeSwitchMode(int scrnIndex, void *mode); extern _X_EXPORT Bool VidModeLockZoom(int scrnIndex, Bool lock); -extern _X_EXPORT Bool VidModeGetMonitor(int scrnIndex, pointer *monitor); +extern _X_EXPORT Bool VidModeGetMonitor(int scrnIndex, void **monitor); extern _X_EXPORT int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock); extern _X_EXPORT Bool VidModeGetClocks(int scrnIndex, int *Clocks); extern _X_EXPORT ModeStatus VidModeCheckModeForMonitor(int scrnIndex, - pointer mode); + void *mode); extern _X_EXPORT ModeStatus VidModeCheckModeForDriver(int scrnIndex, - pointer mode); -extern _X_EXPORT void VidModeSetCrtcForMode(int scrnIndex, pointer mode); -extern _X_EXPORT Bool VidModeAddModeline(int scrnIndex, pointer mode); + void *mode); +extern _X_EXPORT void VidModeSetCrtcForMode(int scrnIndex, void *mode); +extern _X_EXPORT Bool VidModeAddModeline(int scrnIndex, void *mode); extern _X_EXPORT int VidModeGetDotClock(int scrnIndex, int Clock); extern _X_EXPORT int VidModeGetNumOfModes(int scrnIndex); extern _X_EXPORT Bool VidModeSetGamma(int scrnIndex, float red, float green, float blue); extern _X_EXPORT Bool VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue); -extern _X_EXPORT pointer VidModeCreateMode(void); -extern _X_EXPORT void VidModeCopyMode(pointer modefrom, pointer modeto); -extern _X_EXPORT int VidModeGetModeValue(pointer mode, int valtyp); -extern _X_EXPORT void VidModeSetModeValue(pointer mode, int valtyp, int val); -extern _X_EXPORT vidMonitorValue VidModeGetMonitorValue(pointer monitor, +extern _X_EXPORT void *VidModeCreateMode(void); +extern _X_EXPORT void VidModeCopyMode(void *modefrom, void *modeto); +extern _X_EXPORT int VidModeGetModeValue(void *mode, int valtyp); +extern _X_EXPORT void VidModeSetModeValue(void *mode, int valtyp, int val); +extern _X_EXPORT vidMonitorValue VidModeGetMonitorValue(void *monitor, int valtyp, int indx); extern _X_EXPORT Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); diff --git a/xorg-server/hw/xfree86/common/xf86.h b/xorg-server/hw/xfree86/common/xf86.h index eada01cf9..89025fe11 100644 --- a/xorg-server/hw/xfree86/common/xf86.h +++ b/xorg-server/hw/xfree86/common/xf86.h @@ -128,7 +128,7 @@ extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, void *dummy, EntityProc init, EntityProc enter, EntityProc leave, - pointer private); + void *private); /* Obsolete! don't use */ extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, @@ -136,7 +136,7 @@ extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, void *dummy, EntityProc init, EntityProc enter, EntityProc leave, - pointer private); + void *private); #else #define xf86VGAarbiterInit() do {} while (0) #define xf86VGAarbiterFini() do {} while (0) @@ -166,7 +166,7 @@ extern _X_EXPORT void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex); extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, - pointer); + void *); extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex); extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); @@ -203,11 +203,6 @@ extern _X_EXPORT void xf86ReconfigureLayout(void); extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags); -#ifdef DPMSExtension -extern _X_EXPORT int DPMSSet(ClientPtr client, int level); -extern _X_EXPORT Bool DPMSSupported(void); -#endif - /* xf86DGA.c */ #ifdef XFreeXDGA @@ -221,18 +216,18 @@ extern _X_EXPORT xf86SetDGAModeProc xf86SetDGAMode; /* xf86Events.c */ extern _X_EXPORT void SetTimeSinceLastInputEvent(void); -extern _X_EXPORT pointer xf86AddInputHandler(int fd, InputHandlerProc proc, - pointer data); -extern _X_EXPORT int xf86RemoveInputHandler(pointer handler); -extern _X_EXPORT void xf86DisableInputHandler(pointer handler); -extern _X_EXPORT void xf86EnableInputHandler(pointer handler); -extern _X_EXPORT pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc, - pointer data); -extern _X_EXPORT int xf86RemoveGeneralHandler(pointer handler); -extern _X_EXPORT void xf86DisableGeneralHandler(pointer handler); -extern _X_EXPORT void xf86EnableGeneralHandler(pointer handler); +extern _X_EXPORT void *xf86AddInputHandler(int fd, InputHandlerProc proc, + void *data); +extern _X_EXPORT int xf86RemoveInputHandler(void *handler); +extern _X_EXPORT void xf86DisableInputHandler(void *handler); +extern _X_EXPORT void xf86EnableInputHandler(void *handler); +extern _X_EXPORT void *xf86AddGeneralHandler(int fd, InputHandlerProc proc, + void *data); +extern _X_EXPORT int xf86RemoveGeneralHandler(void *handler); +extern _X_EXPORT void xf86DisableGeneralHandler(void *handler); +extern _X_EXPORT void xf86EnableGeneralHandler(void *handler); extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc - handler, pointer data); + handler, void *data); extern _X_EXPORT void xf86InterceptSignals(int *signo); extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void)); extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new); @@ -242,7 +237,7 @@ extern _X_EXPORT Bool xf86VTOwner(void); /* xf86Helper.c */ -extern _X_EXPORT void xf86AddDriver(DriverPtr driver, pointer module, +extern _X_EXPORT void xf86AddDriver(DriverPtr driver, void *module, int flags); extern _X_EXPORT void xf86DeleteDriver(int drvIndex); extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags); @@ -333,36 +328,36 @@ xf86DisableRandR(void); extern _X_EXPORT CARD32 xorgGetVersion(void); extern _X_EXPORT CARD32 -xf86GetModuleVersion(pointer module); -extern _X_EXPORT pointer +xf86GetModuleVersion(void *module); +extern _X_EXPORT void * xf86LoadDrvSubModule(DriverPtr drv, const char *name); -extern _X_EXPORT pointer +extern _X_EXPORT void * xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name); -extern _X_EXPORT pointer -xf86LoadOneModule(char *name, pointer optlist); +extern _X_EXPORT void * +xf86LoadOneModule(const char *name, void *optlist); extern _X_EXPORT void -xf86UnloadSubModule(pointer mod); +xf86UnloadSubModule(void *mod); extern _X_EXPORT Bool xf86LoaderCheckSymbol(const char *name); extern _X_EXPORT void xf86SetBackingStore(ScreenPtr pScreen); extern _X_EXPORT void xf86SetSilkenMouse(ScreenPtr pScreen); -extern _X_EXPORT pointer -xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, char *port_name, - char **adaptor_name, pointer *adaptor_options); +extern _X_EXPORT void * +xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, const char *port_name, + const char **adaptor_name, void **adaptor_options); extern _X_EXPORT void xf86GetOS(const char **name, int *major, int *minor, int *teeny); extern _X_EXPORT ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, EntityProc init, - EntityProc enter, EntityProc leave, pointer private); + EntityProc enter, EntityProc leave, void *private); extern _X_EXPORT Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn); extern _X_EXPORT int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, - int format, unsigned long len, pointer value); + int format, unsigned long len, void *value); extern _X_EXPORT Bool xf86IsUnblank(int mode); @@ -394,7 +389,7 @@ extern _X_EXPORT ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags); extern _X_EXPORT int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, - char **modeNames, ClockRangePtr clockRanges, + const char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int minHeight, int maxHeight, int pitchInc, int virtualX, int virtualY, int apertureSize, diff --git a/xorg-server/hw/xfree86/common/xf86AutoConfig.c b/xorg-server/hw/xfree86/common/xf86AutoConfig.c index af2b7f8f2..4eb86de22 100644 --- a/xorg-server/hw/xfree86/common/xf86AutoConfig.c +++ b/xorg-server/hw/xfree86/common/xf86AutoConfig.c @@ -300,6 +300,7 @@ copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) { confScreenPtr nscreen; GDevPtr cptr = NULL; + char *identifier; nscreen = malloc(sizeof(confScreenRec)); if (!nscreen) @@ -313,13 +314,14 @@ copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) } memcpy(cptr, odev, sizeof(GDevRec)); - if (asprintf(&cptr->identifier, "Autoconfigured Video Device %s", driver) + if (asprintf(&identifier, "Autoconfigured Video Device %s", driver) == -1) { free(cptr); free(nscreen); return FALSE; } cptr->driver = driver; + cptr->identifier = identifier; xf86ConfigLayout.screens[i].screen = nscreen; diff --git a/xorg-server/hw/xfree86/common/xf86Bus.c b/xorg-server/hw/xfree86/common/xf86Bus.c index d463e9196..507c57dbc 100644 --- a/xorg-server/hw/xfree86/common/xf86Bus.c +++ b/xorg-server/hw/xfree86/common/xf86Bus.c @@ -288,7 +288,7 @@ xf86IsEntityPrimary(int entityIndex) Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, - EntityProc leave, pointer private) + EntityProc leave, void *private) { if (entityIndex >= xf86NumEntities) return FALSE; diff --git a/xorg-server/hw/xfree86/common/xf86Bus.h b/xorg-server/hw/xfree86/common/xf86Bus.h index e83ba780a..c59625db6 100644 --- a/xorg-server/hw/xfree86/common/xf86Bus.h +++ b/xorg-server/hw/xfree86/common/xf86Bus.h @@ -51,7 +51,7 @@ typedef struct { EntityProc entityInit; EntityProc entityEnter; EntityProc entityLeave; - pointer private; + void *private; Bool active; Bool inUse; BusRec bus; diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c index b5efc02af..5be1693d8 100644 --- a/xorg-server/hw/xfree86/common/xf86Config.c +++ b/xorg-server/hw/xfree86/common/xf86Config.c @@ -171,7 +171,7 @@ xf86GetPathElem(char **pnt) static char * xf86ValidateFontPath(char *path) { - char *tmp_path, *out_pnt, *path_elem, *next, *p1, *dir_elem; + char *next, *tmp_path, *out_pnt, *path_elem, *p1, *dir_elem; struct stat stat_buf; int flag; int dirlen; @@ -236,17 +236,17 @@ xf86ValidateFontPath(char *path) * use the datastructure that the parser provides and pick out the parts * that we need at this point */ -char ** -xf86ModulelistFromConfig(pointer **optlist) +const char ** +xf86ModulelistFromConfig(void ***optlist) { int count = 0, i = 0; - char **modulearray; + const char **modulearray; const char *ignore[] = { "GLcore", "speedo", "bitmap", "drm", "freetype", "type1", NULL }; - pointer *optarray; + void **optarray; XF86LoadPtr modp; Bool found; @@ -352,7 +352,7 @@ xf86ModulelistFromConfig(pointer **optlist) * allocate the memory and walk the list again to fill in the pointers */ modulearray = xnfalloc((count + 1) * sizeof(char *)); - optarray = xnfalloc((count + 1) * sizeof(pointer)); + optarray = xnfalloc((count + 1) * sizeof(void *)); count = 0; if (xf86configptr->conf_modules) { modp = xf86configptr->conf_modules->mod_load_lst; @@ -374,12 +374,12 @@ xf86ModulelistFromConfig(pointer **optlist) return modulearray; } -char ** +const char ** xf86DriverlistFromConfig(void) { int count = 0; int j; - char **modulearray; + const char **modulearray; screenLayoutPtr slp; /* @@ -446,11 +446,11 @@ xf86DriverlistFromConfig(void) return modulearray; } -char ** +const char ** xf86InputDriverlistFromConfig(void) { int count = 0; - char **modulearray; + const char **modulearray; InputInfoPtr *idp; /* @@ -505,11 +505,11 @@ xf86InputDriverlistFromConfig(void) } static void -fixup_video_driver_list(char **drivers) +fixup_video_driver_list(const char **drivers) { static const char *fallback[4] = { "fbdev", "vesa", "wsfb", NULL }; - char **end, **drv; - char *x; + const char **end, **drv; + const char *x; int i; /* walk to the end of the list */ @@ -533,10 +533,10 @@ fixup_video_driver_list(char **drivers) } } -static char ** +static const char ** GenerateDriverlist(const char *dirname) { - char **ret; + const char **ret; const char *subdirs[] = { dirname, NULL }; static const char *patlist[] = { "(.*)_drv\\.so", NULL }; ret = LoaderListDirs(subdirs, patlist); @@ -548,10 +548,10 @@ GenerateDriverlist(const char *dirname) return ret; } -char ** +const char ** xf86DriverlistFromCompile(void) { - static char **driverlist = NULL; + static const char **driverlist = NULL; if (!driverlist) driverlist = GenerateDriverlist("drivers"); @@ -589,33 +589,35 @@ configFiles(XF86ConfFilesPtr fileconf) /* FontPath */ must_copy = TRUE; - temp_path = defaultFontPath ? defaultFontPath : ""; + temp_path = defaultFontPath ? (char *) defaultFontPath : (char *) ""; if (xf86fpFlag) pathFrom = X_CMDLINE; else if (fileconf && fileconf->file_fontpath) { pathFrom = X_CONFIG; if (xf86Info.useDefaultFontPath) { - if (asprintf(&defaultFontPath, "%s%s%s", fileconf->file_fontpath, + char *new_font_path; + if (asprintf(&new_font_path, "%s%s%s", fileconf->file_fontpath, *temp_path ? "," : "", temp_path) == -1) - defaultFontPath = NULL; + new_font_path = NULL; else must_copy = FALSE; + defaultFontPath = new_font_path; } else defaultFontPath = fileconf->file_fontpath; } else pathFrom = X_DEFAULT; - temp_path = defaultFontPath ? defaultFontPath : ""; + temp_path = defaultFontPath ? (char *) defaultFontPath : (char *) ""; /* xf86ValidateFontPath modifies its argument, but returns a copy of it. */ - temp_path = must_copy ? xnfstrdup(defaultFontPath) : defaultFontPath; + temp_path = must_copy ? xnfstrdup(defaultFontPath) : (char *) defaultFontPath; defaultFontPath = xf86ValidateFontPath(temp_path); free(temp_path); /* make fontpath more readable in the logfiles */ countDirs = 1; - temp_path = defaultFontPath; + temp_path = (char *) defaultFontPath; while ((temp_path = index(temp_path, ',')) != NULL) { countDirs++; temp_path++; @@ -623,7 +625,7 @@ configFiles(XF86ConfFilesPtr fileconf) log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1); temp_path = log_buf; - start = defaultFontPath; + start = (char *) defaultFontPath; while ((end = index(start, ',')) != NULL) { size = (end - start) + 1; *(temp_path++) = '\t'; @@ -2349,7 +2351,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) ConfigStatus xf86HandleConfigFile(Bool autoconfig) { - char *scanptr; + const char *scanptr; Bool singlecard = 0; Bool implicit_layout = FALSE; @@ -2444,7 +2446,7 @@ xf86HandleConfigFile(Bool autoconfig) else { if (xf86configptr->conf_flags != NULL) { char *dfltlayout = NULL; - pointer optlist = xf86configptr->conf_flags->flg_option_lst; + void *optlist = xf86configptr->conf_flags->flg_option_lst; if (optlist && xf86FindOption(optlist, "defaultserverlayout")) dfltlayout = diff --git a/xorg-server/hw/xfree86/common/xf86Config.h b/xorg-server/hw/xfree86/common/xf86Config.h index de06677c3..23fb383c3 100644 --- a/xorg-server/hw/xfree86/common/xf86Config.h +++ b/xorg-server/hw/xfree86/common/xf86Config.h @@ -59,10 +59,10 @@ typedef struct _ModuleDefault { /* * prototypes */ -char **xf86ModulelistFromConfig(pointer **); -char **xf86DriverlistFromConfig(void); -char **xf86DriverlistFromCompile(void); -char **xf86InputDriverlistFromConfig(void); +const char **xf86ModulelistFromConfig(void ***); +const char **xf86DriverlistFromConfig(void); +const char **xf86DriverlistFromCompile(void); +const char **xf86InputDriverlistFromConfig(void); Bool xf86BuiltinInputDriver(const char *); ConfigStatus xf86HandleConfigFile(Bool); diff --git a/xorg-server/hw/xfree86/common/xf86Configure.c b/xorg-server/hw/xfree86/common/xf86Configure.c index 91e8df93d..1348b2753 100644 --- a/xorg-server/hw/xfree86/common/xf86Configure.c +++ b/xorg-server/hw/xfree86/common/xf86Configure.c @@ -81,6 +81,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int chipset) { int ret, i, j; + char *lower_driver; if (!xf86DoConfigure || !xf86DoConfigurePass1) return NULL; @@ -117,8 +118,9 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, DevToConfig[i].iDriver = CurrentDriver; /* Fill in what we know, converting the driver name to lower case */ - DevToConfig[i].GDev.driver = xnfalloc(strlen(driver) + 1); - for (j = 0; (DevToConfig[i].GDev.driver[j] = tolower(driver[j])); j++); + lower_driver = xnfalloc(strlen(driver) + 1); + for (j = 0; (lower_driver[j] = tolower(driver[j])); j++); + DevToConfig[i].GDev.driver = lower_driver; switch (bus) { #ifdef XSERVER_LIBPCIACCESS @@ -193,11 +195,15 @@ configureScreenSection(int screennum) { int i; int depths[] = { 1, 4, 8, 15, 16, 24 /*, 32 */ }; + char *tmp; parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec) - XNFasprintf(&ptr->scrn_identifier, "Screen%d", screennum); - XNFasprintf(&ptr->scrn_monitor_str, "Monitor%d", screennum); - XNFasprintf(&ptr->scrn_device_str, "Card%d", screennum); + XNFasprintf(&tmp, "Screen%d", screennum); + ptr->scrn_identifier = tmp; + XNFasprintf(&tmp, "Monitor%d", screennum); + ptr->scrn_monitor_str = tmp; + XNFasprintf(&tmp, "Card%d", screennum); + ptr->scrn_device_str = tmp; for (i = 0; i < sizeof(depths) / sizeof(depths[0]); i++) { XF86ConfDisplayPtr display; @@ -246,12 +252,14 @@ configureDeviceSection(int screennum) { OptionInfoPtr p; int i = 0; + char *identifier; parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec) /* Move device info to parser structure */ - if (asprintf(&ptr->dev_identifier, "Card%d", screennum) == -1) - ptr->dev_identifier = NULL; + if (asprintf(&identifier, "Card%d", screennum) == -1) + identifier = NULL; + ptr->dev_identifier = identifier; ptr->dev_chipset = DevToConfig[screennum].GDev.chipset; ptr->dev_busid = DevToConfig[screennum].GDev.busID; ptr->dev_driver = DevToConfig[screennum].GDev.driver; @@ -353,20 +361,24 @@ configureLayoutSection(void) for (scrnum = 0; scrnum < nDevToConfig; scrnum++) { XF86ConfAdjacencyPtr aptr; + char *tmp; aptr = malloc(sizeof(XF86ConfAdjacencyRec)); aptr->list.next = NULL; aptr->adj_x = 0; aptr->adj_y = 0; aptr->adj_scrnum = scrnum; - XNFasprintf(&aptr->adj_screen_str, "Screen%d", scrnum); + XNFasprintf(&tmp, "Screen%d", scrnum); + aptr->adj_screen_str = tmp; if (scrnum == 0) { aptr->adj_where = CONF_ADJ_ABSOLUTE; aptr->adj_refscreen = NULL; } else { + char *tmp; aptr->adj_where = CONF_ADJ_RIGHTOF; - XNFasprintf(&aptr->adj_refscreen, "Screen%d", scrnum - 1); + XNFasprintf(&tmp, "Screen%d", scrnum - 1); + aptr->adj_refscreen = tmp; } ptr->lay_adjacency_lst = (XF86ConfAdjacencyPtr) xf86addListItem((glp) ptr->lay_adjacency_lst, @@ -387,7 +399,7 @@ configureFlagsSection(void) static XF86ConfModulePtr configureModuleSection(void) { - char **elist, **el; + const char **elist, **el; /* Find the list of extension & font modules. */ const char *esubdirs[] = { @@ -430,9 +442,11 @@ configureFilesSection(void) static XF86ConfMonitorPtr configureMonitorSection(int screennum) { + char *tmp; parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec) - XNFasprintf(&ptr->mon_identifier, "Monitor%d", screennum); + XNFasprintf(&tmp, "Monitor%d", screennum); + ptr->mon_identifier = tmp; ptr->mon_vendor = strdup("Monitor Vendor"); ptr->mon_modelname = strdup("Monitor Model"); @@ -472,10 +486,12 @@ configureDDCMonitorSection(int screennum) #define displaySizeMaxLen 80 char displaySize_string[displaySizeMaxLen]; int displaySizeLen; + char *tmp; parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec) - XNFasprintf(&ptr->mon_identifier, "Monitor%d", screennum); + XNFasprintf(&tmp, "Monitor%d", screennum); + ptr->mon_identifier = tmp; ptr->mon_vendor = strdup(ConfiguredMonitor->vendor.name); XNFasprintf(&ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id); @@ -528,7 +544,7 @@ DoConfigure(void) char filename[PATH_MAX]; const char *addslash = ""; XF86ConfigPtr xf86config = NULL; - char **vlist, **vl; + const char **vlist, **vl; int *dev2screen; vlist = xf86DriverlistFromCompile(); @@ -766,7 +782,7 @@ void DoShowOptions(void) { int i = 0; - char **vlist = 0; + const char **vlist = NULL; char *pSymbol = 0; XF86ModuleData *initData = 0; diff --git a/xorg-server/hw/xfree86/common/xf86DGA.c b/xorg-server/hw/xfree86/common/xf86DGA.c index 6a05ce536..b9e1e3f88 100644 --- a/xorg-server/hw/xfree86/common/xf86DGA.c +++ b/xorg-server/hw/xfree86/common/xf86DGA.c @@ -450,7 +450,7 @@ xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet) pMode->pixmapHeight, pMode->depth, pMode->bitsPerPixel, pMode->bytesPerScanline, - (pointer) (pMode->address)); + (void *) (pMode->address)); } } @@ -1214,7 +1214,7 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device) static void XDGAResetProc(ExtensionEntry * extEntry); -static void DGAClientStateChange(CallbackListPtr *, pointer, pointer); +static void DGAClientStateChange(CallbackListPtr *, void *, void *); static DevPrivateKeyRec DGAScreenPrivateKeyRec; @@ -1404,7 +1404,7 @@ ProcXDGAQueryModes(ClientPtr client) } static void -DGAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) +DGAClientStateChange(CallbackListPtr *pcbl, void *nulldata, void *calldata) { NewClientInfoRec *pci = (NewClientInfoRec *) calldata; ClientPtr client = NULL; @@ -1484,7 +1484,7 @@ ProcXDGASetMode(ClientPtr client) DGA_SETCLIENT(stuff->screen, client); if (pPix) { - if (AddResource(stuff->pid, RT_PIXMAP, (pointer) (pPix))) { + if (AddResource(stuff->pid, RT_PIXMAP, (void *) (pPix))) { pPix->drawable.id = (int) stuff->pid; rep.flags = DGA_PIXMAP_AVAILABLE; } @@ -1562,7 +1562,7 @@ ProcXDGAInstallColormap(ClientPtr client) REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); - rc = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, RT_COLORMAP, + rc = dixLookupResourceByType((void **) &cmap, stuff->cmap, RT_COLORMAP, client, DixInstallAccess); if (rc != Success) return rc; @@ -1991,7 +1991,7 @@ ProcXF86DGAInstallColormap(ClientPtr client) if (!DGAActive(stuff->screen)) return DGAErrorBase + XF86DGADirectNotActivated; - rc = dixLookupResourceByType((pointer *) &pcmp, stuff->id, RT_COLORMAP, + rc = dixLookupResourceByType((void **) &pcmp, stuff->id, RT_COLORMAP, client, DixInstallAccess); if (rc == Success) { DGAInstallCmap(pcmp); diff --git a/xorg-server/hw/xfree86/common/xf86DPMS.c b/xorg-server/hw/xfree86/common/xf86DPMS.c index 881cb2773..14d1f4545 100644 --- a/xorg-server/hw/xfree86/common/xf86DPMS.c +++ b/xorg-server/hw/xfree86/common/xf86DPMS.c @@ -60,7 +60,7 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) #ifdef DPMSExtension ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DPMSPtr pDPMS; - pointer DPMSOpt; + void *DPMSOpt; MessageType enabled_from; DPMSKey = &DPMSKeyRec; diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c index d0b14314b..cae78732c 100644 --- a/xorg-server/hw/xfree86/common/xf86Events.c +++ b/xorg-server/hw/xfree86/common/xf86Events.c @@ -114,7 +114,7 @@ static void xf86VTSwitch(void); typedef struct x_IHRec { int fd; InputHandlerProc ihproc; - pointer data; + void *data; Bool enabled; Bool is_input; struct x_IHRec *next; @@ -243,7 +243,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) /* ARGSUSED */ void -xf86Wakeup(pointer blockData, int err, pointer pReadmask) +xf86Wakeup(void *blockData, int err, void *pReadmask) { fd_set *LastSelectMask = (fd_set *) pReadmask; fd_set devicesWithInput; @@ -583,8 +583,8 @@ xf86VTSwitch(void) /* Input handler registration */ -static pointer -addInputHandler(int fd, InputHandlerProc proc, pointer data) +static void * +addInputHandler(int fd, InputHandlerProc proc, void *data) { IHPtr ih; @@ -606,8 +606,8 @@ addInputHandler(int fd, InputHandlerProc proc, pointer data) return ih; } -pointer -xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data) +void * +xf86AddInputHandler(int fd, InputHandlerProc proc, void *data) { IHPtr ih = addInputHandler(fd, proc, data); @@ -618,8 +618,8 @@ xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data) return ih; } -pointer -xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) +void * +xf86AddGeneralHandler(int fd, InputHandlerProc proc, void *data) { IHPtr ih = addInputHandler(fd, proc, data); @@ -634,7 +634,7 @@ xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) * proc may be NULL if the server should not handle events on the console. */ InputHandlerProc -xf86SetConsoleHandler(InputHandlerProc proc, pointer data) +xf86SetConsoleHandler(InputHandlerProc proc, void *data) { static IHPtr handler = NULL; InputHandlerProc old_proc = NULL; @@ -667,7 +667,7 @@ removeInputHandler(IHPtr ih) } int -xf86RemoveInputHandler(pointer handler) +xf86RemoveInputHandler(void *handler) { IHPtr ih; int fd; @@ -686,7 +686,7 @@ xf86RemoveInputHandler(pointer handler) } int -xf86RemoveGeneralHandler(pointer handler) +xf86RemoveGeneralHandler(void *handler) { IHPtr ih; int fd; @@ -705,7 +705,7 @@ xf86RemoveGeneralHandler(pointer handler) } void -xf86DisableInputHandler(pointer handler) +xf86DisableInputHandler(void *handler) { IHPtr ih; @@ -719,7 +719,7 @@ xf86DisableInputHandler(pointer handler) } void -xf86DisableGeneralHandler(pointer handler) +xf86DisableGeneralHandler(void *handler) { IHPtr ih; @@ -733,7 +733,7 @@ xf86DisableGeneralHandler(pointer handler) } void -xf86EnableInputHandler(pointer handler) +xf86EnableInputHandler(void *handler) { IHPtr ih; @@ -747,7 +747,7 @@ xf86EnableInputHandler(pointer handler) } void -xf86EnableGeneralHandler(pointer handler) +xf86EnableGeneralHandler(void *handler) { IHPtr ih; diff --git a/xorg-server/hw/xfree86/common/xf86Extensions.c b/xorg-server/hw/xfree86/common/xf86Extensions.c index f9e791607..c80de34e6 100644 --- a/xorg-server/hw/xfree86/common/xf86Extensions.c +++ b/xorg-server/hw/xfree86/common/xf86Extensions.c @@ -89,7 +89,6 @@ load_extension_config(void) { XF86ConfModulePtr mod_con = xf86configptr->conf_modules; XF86LoadPtr modp; - int i; /* Only the best. */ if (!mod_con) diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c index f1e6783a7..0916deccf 100644 --- a/xorg-server/hw/xfree86/common/xf86Helper.c +++ b/xorg-server/hw/xfree86/common/xf86Helper.c @@ -67,7 +67,7 @@ static int xf86ScrnInfoPrivateCount = 0; /* Add a pointer to a new DriverRec to xf86DriverList */ void -xf86AddDriver(DriverPtr driver, pointer module, int flags) +xf86AddDriver(DriverPtr driver, void *module, int flags) { /* Don't add null entries */ if (!driver) @@ -107,7 +107,7 @@ xf86DeleteDriver(int drvIndex) /* Add a pointer to a new InputDriverRec to xf86InputDriverList */ void -xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags) +xf86AddInputDriver(InputDriverPtr driver, void *module, int flags) { /* Don't add null entries */ if (!driver) @@ -1068,9 +1068,7 @@ void xf86EnableDisableFBAccess(ScrnInfoPtr pScrnInfo, Bool enable) { ScreenPtr pScreen = pScrnInfo->pScreen; - PixmapPtr pspix; - pspix = (*pScreen->GetScreenPixmap) (pScreen); if (enable) { /* * Restore all of the clip lists on the screen @@ -1531,15 +1529,15 @@ xf86DisableRandR(void) } CARD32 -xf86GetModuleVersion(pointer module) +xf86GetModuleVersion(void *module) { return (CARD32) LoaderGetModuleVersion(module); } -pointer +void * xf86LoadDrvSubModule(DriverPtr drv, const char *name) { - pointer ret; + void *ret; int errmaj = 0, errmin = 0; ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL, @@ -1549,10 +1547,10 @@ xf86LoadDrvSubModule(DriverPtr drv, const char *name) return ret; } -pointer +void * xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name) { - pointer ret; + void *ret; int errmaj = 0, errmin = 0; ret = LoadSubModule(pScrn->module, name, NULL, NULL, NULL, NULL, @@ -1565,12 +1563,12 @@ xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name) /* * xf86LoadOneModule loads a single module. */ -pointer -xf86LoadOneModule(char *name, pointer opt) +void * +xf86LoadOneModule(const char *name, void *opt) { int errmaj, errmin; char *Name; - pointer mod; + void *mod; if (!name) return NULL; @@ -1594,7 +1592,7 @@ xf86LoadOneModule(char *name, pointer opt) } void -xf86UnloadSubModule(pointer mod) +xf86UnloadSubModule(void *mod) { UnloadSubModule(mod); } @@ -1697,9 +1695,9 @@ xf86SetSilkenMouse(ScreenPtr pScreen) /* Wrote this function for the PM2 Xv driver, preliminary. */ -pointer -xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, char *port_name, - char **adaptor_name, pointer *adaptor_options) +void * +xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, const char *port_name, + const char **adaptor_name, void **adaptor_options) { confXvAdaptorPtr adaptor; int i; @@ -1731,7 +1729,7 @@ xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, char *port_name, static void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, - EntityProc enter, EntityProc leave, pointer private) + EntityProc enter, EntityProc leave, void *private) { ScrnInfoPtr pScrn; @@ -1743,7 +1741,7 @@ xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, - pointer private) + void *private) { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); @@ -1785,7 +1783,7 @@ xf86IsScreenPrimary(ScrnInfoPtr pScrn) int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, - int format, unsigned long len, pointer value) + int format, unsigned long len, void *value) { RootWinPropPtr pNewProp = NULL, pRegProp; Bool existing = FALSE; @@ -1817,7 +1815,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, pNewProp->next = NULL; } else { - free(pNewProp->name); + free((void *) pNewProp->name); existing = TRUE; } diff --git a/xorg-server/hw/xfree86/common/xf86InPriv.h b/xorg-server/hw/xfree86/common/xf86InPriv.h index 5826ac388..b8229d2c1 100644 --- a/xorg-server/hw/xfree86/common/xf86InPriv.h +++ b/xorg-server/hw/xfree86/common/xf86InPriv.h @@ -37,7 +37,4 @@ extern InputDriverPtr *xf86InputDriverList; extern int xf86NumInputDrivers; -/* xf86Helper.c */ -InputDriverPtr xf86LookupInputDriver(const char *name); - #endif /* _xf86InPriv_h */ diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c index 91ec4c8bb..7c72aa964 100644 --- a/xorg-server/hw/xfree86/common/xf86Init.c +++ b/xorg-server/hw/xfree86/common/xf86Init.c @@ -395,8 +395,8 @@ void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { int i, j, k, scr_index; - char **modulelist; - pointer *optionlist; + const char **modulelist; + void **optionlist; Pix24Flags screenpix24, pix24; MessageType pix24From = X_DEFAULT; Bool pix24Fail = FALSE; @@ -623,7 +623,9 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->name == NULL) { - XNFasprintf(&xf86Screens[i]->name, "screen%d", i); + char *tmp; + XNFasprintf(&tmp, "screen%d", i); + xf86Screens[i]->name = tmp; xf86MsgVerb(X_WARNING, 0, "Screen driver %d has no name set, using `%s'.\n", i, xf86Screens[i]->name); @@ -1536,10 +1538,10 @@ ddxUseMsg(void) * xf86LoadModules iterates over a list that is being passed in. */ Bool -xf86LoadModules(char **list, pointer *optlist) +xf86LoadModules(const char **list, void **optlist) { int errmaj, errmin; - pointer opt; + void *opt; int i; char *name; Bool failed = FALSE; diff --git a/xorg-server/hw/xfree86/common/xf86Mode.c b/xorg-server/hw/xfree86/common/xf86Mode.c index 706ab64fc..44bc55953 100644 --- a/xorg-server/hw/xfree86/common/xf86Mode.c +++ b/xorg-server/hw/xfree86/common/xf86Mode.c @@ -1354,7 +1354,7 @@ scanLineWidth(unsigned int xsize, /* pixels */ int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, - char **modeNames, ClockRangePtr clockRanges, + const char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int pitchInc, int minHeight, int maxHeight, int virtualX, int virtualY, int apertureSize, LookupModeFlags strategy) @@ -1998,7 +1998,7 @@ xf86DeleteMode(DisplayModePtr * modeList, DisplayModePtr mode) mode->next->prev = mode->prev; } - free(mode->name); + free((void *) mode->name); free(mode); } diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h index 265b55348..b6ec19d13 100644 --- a/xorg-server/hw/xfree86/common/xf86Module.h +++ b/xorg-server/hw/xfree86/common/xf86Module.h @@ -170,13 +170,13 @@ typedef struct { #define INITARGS void /* Prototypes for Loader functions that are exported to modules */ -extern _X_EXPORT pointer LoadSubModule(pointer, const char *, const char **, - const char **, pointer, +extern _X_EXPORT void *LoadSubModule(void *, const char *, const char **, + const char **, void *, const XF86ModReqInfo *, int *, int *); -extern _X_EXPORT void UnloadSubModule(pointer); -extern _X_EXPORT void UnloadModule(pointer); -extern _X_EXPORT pointer LoaderSymbol(const char *); -extern _X_EXPORT char **LoaderListDirs(const char **, const char **); +extern _X_EXPORT void UnloadSubModule(void *); +extern _X_EXPORT void UnloadModule(void *); +extern _X_EXPORT void *LoaderSymbol(const char *); +extern _X_EXPORT const char **LoaderListDirs(const char **, const char **); extern _X_EXPORT void LoaderFreeDirList(char **); extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int); extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor, @@ -184,11 +184,11 @@ extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor, extern _X_EXPORT Bool LoaderShouldIgnoreABI(void); extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass); -typedef pointer (*ModuleSetupProc) (pointer, pointer, int *, int *); -typedef void (*ModuleTearDownProc) (pointer); +typedef void *(*ModuleSetupProc) (void *, void *, int *, int *); +typedef void (*ModuleTearDownProc) (void *); -#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*) -#define MODULETEARDOWNPROTO(func) void func(pointer) +#define MODULESETUPPROTO(func) void *func(void *, void *, int*, int*) +#define MODULETEARDOWNPROTO(func) void func(void *) typedef struct { XF86ModuleVersionInfo *vers; diff --git a/xorg-server/hw/xfree86/common/xf86Opt.h b/xorg-server/hw/xfree86/common/xf86Opt.h index c3ba2d75c..3be2a0fc7 100644 --- a/xorg-server/hw/xfree86/common/xf86Opt.h +++ b/xorg-server/hw/xfree86/common/xf86Opt.h @@ -39,7 +39,7 @@ typedef struct { typedef union { unsigned long num; - char *str; + const char *str; double realnum; Bool bool; OptFrequency freq; @@ -123,7 +123,7 @@ extern _X_EXPORT OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec * table, extern _X_EXPORT const char *xf86TokenToOptName(const OptionInfoRec * table, int token); extern _X_EXPORT Bool xf86IsOptionSet(const OptionInfoRec * table, int token); -extern _X_EXPORT char *xf86GetOptValString(const OptionInfoRec * table, +extern _X_EXPORT const char *xf86GetOptValString(const OptionInfoRec * table, int token); extern _X_EXPORT Bool xf86GetOptValInteger(const OptionInfoRec * table, int token, int *value); diff --git a/xorg-server/hw/xfree86/common/xf86Option.c b/xorg-server/hw/xfree86/common/xf86Option.c index 607c33354..0e8bc1f83 100644 --- a/xorg-server/hw/xfree86/common/xf86Option.c +++ b/xorg-server/hw/xfree86/common/xf86Option.c @@ -478,7 +478,8 @@ static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p, Bool markUsed) { - char *s, *end; + const char *s; + char *end; Bool wasUsed = FALSE; if ((s = xf86findOptionValue(options, p->name)) != NULL) { @@ -755,7 +756,7 @@ xf86IsOptionSet(const OptionInfoRec * table, int token) return p && p->found; } -char * +const char * xf86GetOptValString(const OptionInfoRec * table, int token) { OptionInfoPtr p; diff --git a/xorg-server/hw/xfree86/common/xf86Optionstr.h b/xorg-server/hw/xfree86/common/xf86Optionstr.h index c38499cb5..4ef917dee 100644 --- a/xorg-server/hw/xfree86/common/xf86Optionstr.h +++ b/xorg-server/hw/xfree86/common/xf86Optionstr.h @@ -31,10 +31,10 @@ */ typedef struct _XF86OptionRec { GenericListRec list; - char *opt_name; - char *opt_val; + const char *opt_name; + const char *opt_val; int opt_used; - char *opt_comment; + const char *opt_comment; } XF86OptionRec; typedef struct _InputOption *XF86OptionPtr; diff --git a/xorg-server/hw/xfree86/common/xf86PM.c b/xorg-server/hw/xfree86/common/xf86PM.c index 15257cb81..9e49e8eaf 100644 --- a/xorg-server/hw/xfree86/common/xf86PM.c +++ b/xorg-server/hw/xfree86/common/xf86PM.c @@ -196,7 +196,7 @@ DoApmEvent(pmEvent event, Bool undo) #define MAX_NO_EVENTS 8 void -xf86HandlePMEvents(int fd, pointer data) +xf86HandlePMEvents(int fd, void *data) { pmEvent events[MAX_NO_EVENTS]; int i, n; diff --git a/xorg-server/hw/xfree86/common/xf86Priv.h b/xorg-server/hw/xfree86/common/xf86Priv.h index 58cfe0a1a..6e374eb7e 100644 --- a/xorg-server/hw/xfree86/common/xf86Priv.h +++ b/xorg-server/hw/xfree86/common/xf86Priv.h @@ -139,11 +139,11 @@ DoShowOptions(void) /* xf86Events.c */ extern _X_EXPORT void -xf86Wakeup(pointer blockData, int err, pointer pReadmask); +xf86Wakeup(void *blockData, int err, void *pReadmask); extern _X_HIDDEN int xf86SigWrapper(int signo); extern _X_EXPORT void -xf86HandlePMEvents(int fd, pointer data); +xf86HandlePMEvents(int fd, void *data); extern _X_EXPORT int (*xf86PMGetEventFromOs) (int fd, pmEvent * events, int num); extern _X_EXPORT pmWait (*xf86PMConfirmEventToOs) (int fd, pmEvent event); @@ -156,7 +156,7 @@ xf86CloseLog(enum ExitCode error); /* xf86Init.c */ extern _X_EXPORT Bool -xf86LoadModules(char **list, pointer *optlist); +xf86LoadModules(const char **list, void **optlist); extern _X_EXPORT int xf86SetVerbosity(int verb); extern _X_EXPORT int diff --git a/xorg-server/hw/xfree86/common/xf86Privstr.h b/xorg-server/hw/xfree86/common/xf86Privstr.h index e20be03a9..f7a9c9f1c 100644 --- a/xorg-server/hw/xfree86/common/xf86Privstr.h +++ b/xorg-server/hw/xfree86/common/xf86Privstr.h @@ -136,11 +136,11 @@ typedef struct { /* Information for root window properties. */ typedef struct _RootWinProp { struct _RootWinProp *next; - char *name; + const char *name; Atom type; short format; long size; - pointer data; + void *data; } RootWinProp, *RootWinPropPtr; /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ diff --git a/xorg-server/hw/xfree86/common/xf86VGAarbiter.c b/xorg-server/hw/xfree86/common/xf86VGAarbiter.c index 225fff06e..5cc24298b 100644 --- a/xorg-server/hw/xfree86/common/xf86VGAarbiter.c +++ b/xorg-server/hw/xfree86/common/xf86VGAarbiter.c @@ -257,7 +257,7 @@ VGAarbiterCloseScreen(ScreenPtr pScreen) UNWRAP_SCREEN_INFO(FreeScreen); UNWRAP_SPRITE; - free((pointer) pScreenPriv); + free((void *) pScreenPriv); xf86VGAarbiterLock(xf86ScreenToScrn(pScreen)); val = (*pScreen->CloseScreen) (pScreen); xf86VGAarbiterUnlock(xf86ScreenToScrn(pScreen)); @@ -266,7 +266,7 @@ VGAarbiterCloseScreen(ScreenPtr pScreen) static void VGAarbiterBlockHandler(ScreenPtr pScreen, - pointer pTimeout, pointer pReadmask) + void *pTimeout, void *pReadmask) { SCREEN_PROLOG(BlockHandler); VGAGet(pScreen); @@ -277,7 +277,7 @@ VGAarbiterBlockHandler(ScreenPtr pScreen, static void VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, - pointer pReadmask) + void *pReadmask) { SCREEN_PROLOG(WakeupHandler); VGAGet(pScreen); @@ -586,7 +586,7 @@ VGAarbiterCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) } static void -VGAarbiterChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +VGAarbiterChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { GC_UNWRAP(pGC); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); @@ -860,7 +860,7 @@ VGAarbiterImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) + CharInfoPtr * ppci, void *pglyphBase) { ScreenPtr pScreen = pGC->pScreen; @@ -877,7 +877,7 @@ VGAarbiterPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) + CharInfoPtr * ppci, void *pglyphBase) { ScreenPtr pScreen = pGC->pScreen; diff --git a/xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h b/xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h index ba6edfcc3..ec21bc2f2 100644 --- a/xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h +++ b/xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h @@ -137,15 +137,15 @@ typedef struct _VGAarbiterScreen { } VGAarbiterScreenRec, *VGAarbiterScreenPtr; typedef struct _VGAarbiterGC { - GCOps *wrapOps; - GCFuncs *wrapFuncs; + const GCOps *wrapOps; + const GCFuncs *wrapFuncs; } VGAarbiterGCRec, *VGAarbiterGCPtr; /* Screen funcs */ -static void VGAarbiterBlockHandler(ScreenPtr pScreen, pointer pTimeout, - pointer pReadmask); +static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout, + void *pReadmask); static void VGAarbiterWakeupHandler(ScreenPtr pScreen, - unsigned long result, pointer pReadmask); + unsigned long result, void *pReadmask); static Bool VGAarbiterCloseScreen(ScreenPtr pScreen); static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, @@ -188,7 +188,7 @@ static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes, static void VGAarbiterChangeGC(GCPtr pGC, unsigned long mask); static void VGAarbiterCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void VGAarbiterDestroyGC(GCPtr pGC); -static void VGAarbiterChangeClip(GCPtr pGC, int type, pointer pvalue, +static void VGAarbiterChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); static void VGAarbiterDestroyClip(GCPtr pGC); static void VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc); @@ -236,10 +236,10 @@ static void VGAarbiterImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, unsigned short *chars); static void VGAarbiterImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); + CharInfoPtr * ppci, void *pglyphBase); static void VGAarbiterPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); + CharInfoPtr * ppci, void *pglyphBase); static void VGAarbiterPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg); diff --git a/xorg-server/hw/xfree86/common/xf86VidMode.c b/xorg-server/hw/xfree86/common/xf86VidMode.c index a7d1c25bf..e708b2792 100644 --- a/xorg-server/hw/xfree86/common/xf86VidMode.c +++ b/xorg-server/hw/xfree86/common/xf86VidMode.c @@ -138,7 +138,7 @@ VidModeAvailable(int scrnIndex) } Bool -VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock) +VidModeGetCurrentModeline(int scrnIndex, void **mode, int *dotClock) { ScrnInfoPtr pScrn; @@ -148,7 +148,7 @@ VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock) pScrn = xf86Screens[scrnIndex]; if (pScrn->currentMode) { - *mode = (pointer) (pScrn->currentMode); + *mode = (void *) (pScrn->currentMode); *dotClock = pScrn->currentMode->Clock; return TRUE; @@ -211,7 +211,7 @@ VidModeGetClocks(int scrnIndex, int *Clocks) } Bool -VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock) +VidModeGetFirstModeline(int scrnIndex, void **mode, int *dotClock) { ScrnInfoPtr pScrn; VidModePtr pVidMode; @@ -228,7 +228,7 @@ VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock) pVidMode->Next = pVidMode->First->next; if (pVidMode->First->status == MODE_OK) { - *mode = (pointer) (pVidMode->First); + *mode = (void *) (pVidMode->First); *dotClock = VidModeGetDotClock(scrnIndex, pVidMode->First->Clock); return TRUE; } @@ -237,7 +237,7 @@ VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock) } Bool -VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock) +VidModeGetNextModeline(int scrnIndex, void **mode, int *dotClock) { ScrnInfoPtr pScrn; VidModePtr pVidMode; @@ -252,7 +252,7 @@ VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock) for (p = pVidMode->Next; p != NULL && p != pVidMode->First; p = p->next) { if (p->status == MODE_OK) { pVidMode->Next = p->next; - *mode = (pointer) p; + *mode = (void *) p; *dotClock = VidModeGetDotClock(scrnIndex, p->Clock); return TRUE; } @@ -262,7 +262,7 @@ VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock) } Bool -VidModeDeleteModeline(int scrnIndex, pointer mode) +VidModeDeleteModeline(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; @@ -323,7 +323,7 @@ VidModeGetViewPort(int scrnIndex, int *x, int *y) } Bool -VidModeSwitchMode(int scrnIndex, pointer mode) +VidModeSwitchMode(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; DisplayModePtr pTmpMode; @@ -362,7 +362,7 @@ VidModeLockZoom(int scrnIndex, Bool lock) } Bool -VidModeGetMonitor(int scrnIndex, pointer *monitor) +VidModeGetMonitor(int scrnIndex, void **monitor) { ScrnInfoPtr pScrn; @@ -370,13 +370,13 @@ VidModeGetMonitor(int scrnIndex, pointer *monitor) return FALSE; pScrn = xf86Screens[scrnIndex]; - *monitor = (pointer) (pScrn->monitor); + *monitor = (void *) (pScrn->monitor); return TRUE; } ModeStatus -VidModeCheckModeForMonitor(int scrnIndex, pointer mode) +VidModeCheckModeForMonitor(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; @@ -389,7 +389,7 @@ VidModeCheckModeForMonitor(int scrnIndex, pointer mode) } ModeStatus -VidModeCheckModeForDriver(int scrnIndex, pointer mode) +VidModeCheckModeForDriver(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; @@ -402,7 +402,7 @@ VidModeCheckModeForDriver(int scrnIndex, pointer mode) } void -VidModeSetCrtcForMode(int scrnIndex, pointer mode) +VidModeSetCrtcForMode(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; DisplayModePtr ScreenModes; @@ -421,7 +421,7 @@ VidModeSetCrtcForMode(int scrnIndex, pointer mode) } Bool -VidModeAddModeline(int scrnIndex, pointer mode) +VidModeAddModeline(int scrnIndex, void *mode) { ScrnInfoPtr pScrn; @@ -444,7 +444,7 @@ VidModeAddModeline(int scrnIndex, pointer mode) int VidModeGetNumOfModes(int scrnIndex) { - pointer mode = NULL; + void *mode = NULL; int dotClock = 0, nummodes = 0; if (!VidModeGetFirstModeline(scrnIndex, &mode, &dotClock)) @@ -526,7 +526,7 @@ VidModeGetGammaRampSize(int scrnIndex) return xf86GetGammaRampSize(xf86Screens[scrnIndex]->pScreen); } -pointer +void * VidModeCreateMode(void) { DisplayModePtr mode; @@ -543,13 +543,13 @@ VidModeCreateMode(void) } void -VidModeCopyMode(pointer modefrom, pointer modeto) +VidModeCopyMode(void *modefrom, void *modeto) { memcpy(modeto, modefrom, sizeof(DisplayModeRec)); } int -VidModeGetModeValue(pointer mode, int valtyp) +VidModeGetModeValue(void *mode, int valtyp) { int ret = 0; @@ -592,7 +592,7 @@ VidModeGetModeValue(pointer mode, int valtyp) } void -VidModeSetModeValue(pointer mode, int valtyp, int val) +VidModeSetModeValue(void *mode, int valtyp, int val) { switch (valtyp) { case VIDMODE_H_DISPLAY: @@ -633,7 +633,7 @@ VidModeSetModeValue(pointer mode, int valtyp, int val) } vidMonitorValue -VidModeGetMonitorValue(pointer monitor, int valtyp, int indx) +VidModeGetMonitorValue(void *monitor, int valtyp, int indx) { vidMonitorValue ret = { NULL, }; diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c index 26c03c6c3..3a0151374 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.c +++ b/xorg-server/hw/xfree86/common/xf86Xinput.c @@ -107,7 +107,7 @@ static int * Eval config and modify DeviceVelocityRec accordingly */ static void -ProcessVelocityConfiguration(DeviceIntPtr pDev, char *devname, pointer list, +ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list, DeviceVelocityPtr s) { int tempi; @@ -539,7 +539,7 @@ MatchAttrToken(const char *attr, struct xorg_list *patterns, * match. Each list entry is a separate Match line of the same type. */ xorg_list_for_each_entry(group, patterns, entry) { - char *const *cur; + const char *const *cur; Bool match = FALSE; for (cur = group->values; *cur; cur++) @@ -598,7 +598,7 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev, * See if any of the device's tags match any of the MatchTag tokens. */ if (!xorg_list_is_empty(&iclass->match_tag)) { - char *const *tag; + const char *const *tag; Bool match; if (!attrs->tags) @@ -661,7 +661,7 @@ MergeInputClasses(const InputInfoPtr idev, const InputAttributes * attrs) /* Collect class options and driver settings */ classopts = xf86optionListDup(cl->option_lst); if (cl->driver) { - free(idev->driver); + free((void *) idev->driver); idev->driver = xstrdup(cl->driver); if (!idev->driver) { xf86Msg(X_ERROR, "Failed to allocate memory while merging " @@ -773,8 +773,8 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) /* Else the entry wasn't in the xf86InputDevs list (ignore this). */ } - free(pInp->driver); - free(pInp->name); + free((void *) pInp->driver); + free((void *) pInp->name); xf86optionListFree(pInp->options); free(pInp); } @@ -1067,7 +1067,7 @@ xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute, #if XFreeXDGA ScreenPtr scr = NULL; - int idx, i; + int idx = 0, i; /* The evdev driver may not always send all axes across. */ if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1)) { diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h index 35c38a554..f94261a01 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.h +++ b/xorg-server/hw/xfree86/common/xf86Xinput.h @@ -74,7 +74,7 @@ typedef struct _InputDriverRec { struct _InputInfoRec * pInfo, int flags); void (*UnInit) (struct _InputDriverRec * drv, struct _InputInfoRec * pInfo, int flags); - pointer module; + void *module; const char **default_options; } InputDriverRec, *InputDriverPtr; @@ -82,8 +82,8 @@ typedef struct _InputDriverRec { typedef struct _InputInfoRec { struct _InputInfoRec *next; - char *name; - char *driver; + const char *name; + const char *driver; int flags; @@ -97,10 +97,10 @@ typedef struct _InputInfoRec { int fd; DeviceIntPtr dev; - pointer private; + void *private; const char *type_name; InputDriverPtr drv; - pointer module; + void *module; XF86OptionPtr options; InputAttributes *attrs; } *InputInfoPtr; @@ -178,7 +178,7 @@ int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto); InputInfoPtr xf86AllocateInput(void); /* xf86Helper.c */ -extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, +extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, void *module, int flags); extern _X_EXPORT void xf86DeleteInputDriver(int drvIndex); extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name); diff --git a/xorg-server/hw/xfree86/common/xf86cmap.c b/xorg-server/hw/xfree86/common/xf86cmap.c index 85f35f8db..3f9c88035 100644 --- a/xorg-server/hw/xfree86/common/xf86cmap.c +++ b/xorg-server/hw/xfree86/common/xf86cmap.c @@ -224,7 +224,7 @@ xf86HandleColormaps(ScreenPtr pScreen, ComputeGamma(pScreenPriv); /* get the default map */ - dixLookupResourceByType((pointer *) &pDefMap, pScreen->defColormap, + dixLookupResourceByType((void **) &pDefMap, pScreen->defColormap, RT_COLORMAP, serverClient, DixInstallAccess); if (!CMapAllocateColormapPrivate(pDefMap)) { diff --git a/xorg-server/hw/xfree86/common/xf86fbman.c b/xorg-server/hw/xfree86/common/xf86fbman.c index 4da6af2b6..dafaad304 100644 --- a/xorg-server/hw/xfree86/common/xf86fbman.c +++ b/xorg-server/hw/xfree86/common/xf86fbman.c @@ -74,7 +74,7 @@ xf86FBManagerRunning(ScreenPtr pScreen) Bool xf86RegisterFreeBoxCallback(ScreenPtr pScreen, FreeBoxCallbackProcPtr FreeBoxCallback, - pointer devPriv) + void *devPriv) { FBManagerFuncsPtr funcs; @@ -93,7 +93,7 @@ xf86AllocateOffscreenArea(ScreenPtr pScreen, int w, int h, int gran, MoveAreaCallbackProcPtr moveCB, - RemoveAreaCallbackProcPtr removeCB, pointer privData) + RemoveAreaCallbackProcPtr removeCB, void *privData) { FBManagerFuncsPtr funcs; @@ -113,7 +113,7 @@ xf86AllocateOffscreenLinear(ScreenPtr pScreen, int gran, MoveLinearCallbackProcPtr moveCB, RemoveLinearCallbackProcPtr removeCB, - pointer privData) + void *privData) { FBManagerFuncsPtr funcs; @@ -309,7 +309,7 @@ SendCallFreeBoxCallbacks(FBManagerPtr offman) static Bool localRegisterFreeBoxCallback(ScreenPtr pScreen, FreeBoxCallbackProcPtr FreeBoxCallback, - pointer devPriv) + void *devPriv) { FBManagerPtr offman; FreeBoxCallbackProcPtr *newCallbacks; @@ -346,7 +346,7 @@ AllocateArea(FBManagerPtr offman, int w, int h, int granularity, MoveAreaCallbackProcPtr moveCB, - RemoveAreaCallbackProcPtr removeCB, pointer privData) + RemoveAreaCallbackProcPtr removeCB, void *privData) { ScreenPtr pScreen = offman->pScreen; FBLinkPtr link = NULL; @@ -436,7 +436,7 @@ localAllocateOffscreenArea(ScreenPtr pScreen, int w, int h, int gran, MoveAreaCallbackProcPtr moveCB, - RemoveAreaCallbackProcPtr removeCB, pointer privData) + RemoveAreaCallbackProcPtr removeCB, void *privData) { FBManagerPtr offman; FBAreaPtr area = NULL; @@ -824,7 +824,7 @@ DumpDebug(FBLinearLinkPtr pLink) } static FBLinearPtr -AllocateLinear(FBManagerPtr offman, int size, int granularity, pointer privData) +AllocateLinear(FBManagerPtr offman, int size, int granularity, void *privData) { ScreenPtr pScreen = offman->pScreen; FBLinearLinkPtr linear = NULL; @@ -903,7 +903,7 @@ localAllocateOffscreenLinear(ScreenPtr pScreen, int gran, MoveLinearCallbackProcPtr moveCB, RemoveLinearCallbackProcPtr removeCB, - pointer privData) + void *privData) { FBManagerPtr offman; FBLinearLinkPtr link; @@ -1394,7 +1394,7 @@ xf86AllocateLinearOffscreenArea(ScreenPtr pScreen, int gran, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, - pointer privData) + void *privData) { FBManagerFuncsPtr funcs; FBManagerPtr offman; diff --git a/xorg-server/hw/xfree86/common/xf86fbman.h b/xorg-server/hw/xfree86/common/xf86fbman.h index 99bf9917b..092c2e2dd 100644 --- a/xorg-server/hw/xfree86/common/xf86fbman.h +++ b/xorg-server/hw/xfree86/common/xf86fbman.h @@ -60,7 +60,7 @@ typedef struct _FBLinear { DevUnion devPrivate; } FBLinear, *FBLinearPtr; -typedef void (*FreeBoxCallbackProcPtr) (ScreenPtr, RegionPtr, pointer); +typedef void (*FreeBoxCallbackProcPtr) (ScreenPtr, RegionPtr, void *); typedef void (*MoveAreaCallbackProcPtr) (FBAreaPtr, FBAreaPtr); typedef void (*RemoveAreaCallbackProcPtr) (FBAreaPtr); @@ -73,7 +73,7 @@ typedef struct { int granularity, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, - pointer privData); + void *privData); void (*FreeOffscreenArea) (FBAreaPtr area); Bool (*ResizeOffscreenArea) (FBAreaPtr area, int w, int h); Bool (*QueryLargestOffscreenArea) (ScreenPtr pScreen, @@ -82,14 +82,14 @@ typedef struct { int preferences, int priority); Bool (*RegisterFreeBoxCallback) (ScreenPtr pScreen, FreeBoxCallbackProcPtr FreeBoxCallback, - pointer devPriv); + void *devPriv); /* linear functions */ FBLinearPtr(*AllocateOffscreenLinear) (ScreenPtr pScreen, int size, int granularity, MoveLinearCallbackProcPtr moveCB, RemoveLinearCallbackProcPtr - removeCB, pointer privData); + removeCB, void *privData); void (*FreeOffscreenLinear) (FBLinearPtr area); Bool (*ResizeOffscreenLinear) (FBLinearPtr area, int size); Bool (*QueryLargestOffscreenLinear) (ScreenPtr pScreen, @@ -121,7 +121,7 @@ xf86AllocateOffscreenArea(ScreenPtr pScreen, int w, int h, int granularity, MoveAreaCallbackProcPtr moveCB, - RemoveAreaCallbackProcPtr removeCB, pointer privData); + RemoveAreaCallbackProcPtr removeCB, void *privData); extern _X_EXPORT FBAreaPtr xf86AllocateLinearOffscreenArea(ScreenPtr pScreen, @@ -129,7 +129,7 @@ xf86AllocateLinearOffscreenArea(ScreenPtr pScreen, int granularity, MoveAreaCallbackProcPtr moveCB, RemoveAreaCallbackProcPtr removeCB, - pointer privData); + void *privData); extern _X_EXPORT FBLinearPtr xf86AllocateOffscreenLinear(ScreenPtr pScreen, @@ -137,7 +137,7 @@ xf86AllocateOffscreenLinear(ScreenPtr pScreen, int granularity, MoveLinearCallbackProcPtr moveCB, RemoveLinearCallbackProcPtr removeCB, - pointer privData); + void *privData); extern _X_EXPORT void xf86FreeOffscreenArea(FBAreaPtr area); extern _X_EXPORT void xf86FreeOffscreenLinear(FBLinearPtr area); @@ -152,7 +152,7 @@ extern _X_EXPORT Bool xf86RegisterFreeBoxCallback(ScreenPtr pScreen, FreeBoxCallbackProcPtr FreeBoxCallback, - pointer devPriv); + void *devPriv); extern _X_EXPORT Bool xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen); diff --git a/xorg-server/hw/xfree86/common/xf86pciBus.c b/xorg-server/hw/xfree86/common/xf86pciBus.c index 258988a84..0f76a03ee 100644 --- a/xorg-server/hw/xfree86/common/xf86pciBus.c +++ b/xorg-server/hw/xfree86/common/xf86pciBus.c @@ -575,7 +575,7 @@ xf86PciProbeDev(DriverPtr drvp) } void -xf86PciIsolateDevice(char *argument) +xf86PciIsolateDevice(const char *argument) { int bus, device, func; @@ -1013,7 +1013,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID, static void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets * p_chip, EntityProc init, EntityProc enter, - EntityProc leave, pointer private) + EntityProc leave, void *private) { ScrnInfoPtr pScrn; @@ -1027,7 +1027,7 @@ xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets * p_chip, ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, PciChipsets * p_chip, void *dummy, EntityProc init, - EntityProc enter, EntityProc leave, pointer private) + EntityProc enter, EntityProc leave, void *private) { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); @@ -1068,7 +1068,7 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, PciChipsets * p_chip, void *dummy, EntityProc init, - EntityProc enter, EntityProc leave, pointer private) + EntityProc enter, EntityProc leave, void *private) { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); @@ -1484,6 +1484,7 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, GDevRec * GDev, int *chipset) { char busnum[8]; + char *tmp; pVideo = (struct pci_device *) busData; @@ -1493,8 +1494,9 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, snprintf(busnum, sizeof(busnum), "%d@%d", pVideo->bus & 0x00ff, pVideo->bus >> 8); - XNFasprintf(&GDev->busID, "PCI:%s:%d:%d", + XNFasprintf(&tmp, "PCI:%s:%d:%d", busnum, pVideo->dev, pVideo->func); + GDev->busID = tmp; GDev->chipID = pVideo->device_id; GDev->chipRev = pVideo->revision; diff --git a/xorg-server/hw/xfree86/common/xf86pciBus.h b/xorg-server/hw/xfree86/common/xf86pciBus.h index 4972c3688..b497a7f2d 100644 --- a/xorg-server/hw/xfree86/common/xf86pciBus.h +++ b/xorg-server/hw/xfree86/common/xf86pciBus.h @@ -36,7 +36,7 @@ void xf86PciProbe(void); Bool xf86PciAddMatchingDev(DriverPtr drvp); Bool xf86PciProbeDev(DriverPtr drvp); -void xf86PciIsolateDevice(char *argument); +void xf86PciIsolateDevice(const char *argument); int xf86PciMatchDriver(char *matches[], int nmatches); Bool xf86PciConfigure(void *busData, struct pci_device *pDev); void xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, diff --git a/xorg-server/hw/xfree86/common/xf86platformBus.c b/xorg-server/hw/xfree86/common/xf86platformBus.c index 33b2b7dd8..5875a9136 100644 --- a/xorg-server/hw/xfree86/common/xf86platformBus.c +++ b/xorg-server/hw/xfree86/common/xf86platformBus.c @@ -400,7 +400,7 @@ xf86platformAddDevice(int index) DriverPtr drvp = NULL; int entity; screenLayoutPtr layout; - static char *hotplug_driver_name = "modesetting"; + static const char *hotplug_driver_name = "modesetting"; /* force load the driver for now */ xf86LoadOneModule(hotplug_driver_name, NULL); diff --git a/xorg-server/hw/xfree86/common/xf86sbusBus.h b/xorg-server/hw/xfree86/common/xf86sbusBus.h index a4d9c6cde..9cfcbc574 100644 --- a/xorg-server/hw/xfree86/common/xf86sbusBus.h +++ b/xorg-server/hw/xfree86/common/xf86sbusBus.h @@ -52,16 +52,16 @@ typedef struct sbus_device { int fd; int width, height; sbusPromNode node; - char *descr; - char *device; + const char *descr; + const char *device; } sbusDevice, *sbusDevicePtr; struct sbus_devtable { int devId; int fbType; - char *promName; - char *driverName; - char *descr; + const char *promName; + const char *driverName; + const char *descr; }; extern _X_EXPORT void xf86SbusProbe(void); @@ -76,10 +76,10 @@ extern _X_EXPORT sbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex); extern _X_EXPORT int xf86GetEntityForSbusInfo(sbusDevicePtr psdp); extern _X_EXPORT void xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp); -extern _X_EXPORT pointer xf86MapSbusMem(sbusDevicePtr psdp, +extern _X_EXPORT void *xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size); -extern _X_EXPORT void xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, +extern _X_EXPORT void xf86UnmapSbusMem(sbusDevicePtr psdp, void *addr, unsigned long size); extern _X_EXPORT void xf86SbusHideOsHwCursor(sbusDevicePtr psdp); extern _X_EXPORT void xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, diff --git a/xorg-server/hw/xfree86/common/xf86str.h b/xorg-server/hw/xfree86/common/xf86str.h index 4c2d147a2..b164b7f21 100644 --- a/xorg-server/hw/xfree86/common/xf86str.h +++ b/xorg-server/hw/xfree86/common/xf86str.h @@ -145,7 +145,7 @@ typedef enum { typedef struct _DisplayModeRec { struct _DisplayModeRec *prev; struct _DisplayModeRec *next; - char *name; /* identifier for the mode */ + const char *name; /* identifier for the mode */ ModeStatus status; int type; @@ -212,9 +212,9 @@ typedef struct { #define GAMMA_ZERO (GAMMA_MIN / 100.0) typedef struct { - char *id; - char *vendor; - char *model; + const char *id; + const char *vendor; + const char *model; int nHsync; range hsync[MAX_HSYNC]; int nVrefresh; @@ -224,8 +224,8 @@ typedef struct { Gamma gamma; /* Gamma of the monitor */ int widthmm; int heightmm; - pointer options; - pointer DDC; + void *options; + void *DDC; Bool reducedblanking; /* Allow CVT reduced blanking modes? */ int maxPixClock; /* in kHz, like mode->Clock */ } MonRec, *MonPtr; @@ -259,7 +259,7 @@ typedef enum { GET_REQUIRED_HW_INTERFACES = 10 } xorgDriverFuncOp; -typedef Bool xorgDriverFuncProc(ScrnInfoPtr, xorgDriverFuncOp, pointer); +typedef Bool xorgDriverFuncProc(ScrnInfoPtr, xorgDriverFuncOp, void *); /* RR_GET_INFO, RR_SET_CONFIG */ typedef struct { @@ -299,11 +299,11 @@ struct _DriverRec; typedef struct { int driverVersion; - char *driverName; + const char *driverName; void (*Identify) (int flags); Bool (*Probe) (struct _DriverRec * drv, int flags); const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype); - pointer module; + void *module; int refCount; } DriverRec1; @@ -315,11 +315,11 @@ struct xf86_platform_device; typedef struct _DriverRec { int driverVersion; - char *driverName; + const char *driverName; void (*Identify) (int flags); Bool (*Probe) (struct _DriverRec * drv, int flags); const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype); - pointer module; + void *module; int refCount; xorgDriverFuncProc *driverFunc; @@ -386,19 +386,19 @@ typedef enum { } DacSpeedIndex; typedef struct { - char *identifier; - char *vendor; - char *board; - char *chipset; - char *ramdac; - char *driver; + const char *identifier; + const char *vendor; + const char *board; + const char *chipset; + const char *ramdac; + const char *driver; struct _confscreenrec *myScreenSection; Bool claimed; int dacSpeeds[MAXDACSPEEDS]; int numclocks; int clock[MAXCLOCKS]; - char *clockchip; - char *busID; + const char *clockchip; + const char *busID; Bool active; Bool inUse; int videoRam; @@ -408,7 +408,7 @@ typedef struct { unsigned long IOBase; int chipID; int chipRev; - pointer options; + void *options; int irq; int screen; /* For multi-CRTC cards */ } GDevRec, *GDevPtr; @@ -424,24 +424,24 @@ typedef struct { rgb blackColour; rgb whiteColour; int defaultVisual; - char **modes; - pointer options; + const char **modes; + void *options; } DispRec, *DispPtr; typedef struct _confxvportrec { - char *identifier; - pointer options; + const char *identifier; + void *options; } confXvPortRec, *confXvPortPtr; typedef struct _confxvadaptrec { - char *identifier; + const char *identifier; int numports; confXvPortPtr ports; - pointer options; + void *options; } confXvAdaptorRec, *confXvAdaptorPtr; typedef struct _confscreenrec { - char *id; + const char *id; int screennum; int defaultdepth; int defaultbpp; @@ -452,7 +452,7 @@ typedef struct _confscreenrec { DispPtr displays; int numxvadaptors; confXvAdaptorPtr xvadaptors; - pointer options; + void *options; } confScreenRec, *confScreenPtr; typedef enum { @@ -467,29 +467,29 @@ typedef enum { typedef struct _screenlayoutrec { confScreenPtr screen; - char *topname; + const char *topname; confScreenPtr top; - char *bottomname; + const char *bottomname; confScreenPtr bottom; - char *leftname; + const char *leftname; confScreenPtr left; - char *rightname; + const char *rightname; confScreenPtr right; PositionType where; int x; int y; - char *refname; + const char *refname; confScreenPtr refscreen; } screenLayoutRec, *screenLayoutPtr; typedef struct _InputInfoRec InputInfoRec; typedef struct _serverlayoutrec { - char *id; + const char *id; screenLayoutPtr screens; GDevPtr inactives; InputInfoRec **inputs; /* NULL terminated */ - pointer options; + void *options; } serverLayoutRec, *serverLayoutPtr; typedef struct _confdribufferrec { @@ -512,7 +512,7 @@ typedef struct _confdrirec { #define NUM_RESERVED_POINTERS 14 #define NUM_RESERVED_FUNCS 10 -typedef pointer (*funcPointer) (void); +typedef void *(*funcPointer) (void); /* flags for depth 24 pixmap options */ typedef enum { @@ -581,7 +581,7 @@ typedef struct _PciChipsets { } PciChipsets; /* Entity properties */ -typedef void (*EntityProc) (int entityIndex, pointer private); +typedef void (*EntityProc) (int entityIndex, void *private); typedef struct _entityInfo { int index; @@ -671,7 +671,7 @@ typedef void xf86ModeSetProc(ScrnInfoPtr); typedef struct _ScrnInfoRec { int driverVersion; - char *driverName; /* canonical name used in */ + const char *driverName; /* canonical name used in */ /* the config file */ ScreenPtr pScreen; /* Pointer to the ScreenRec */ int scrnIndex; /* Number of this screen */ @@ -730,20 +730,20 @@ typedef struct _ScrnInfoRec { int heightmm; int xDpi; /* width DPI */ int yDpi; /* height DPI */ - char *name; /* Name to prefix messages */ - pointer driverPrivate; /* Driver private area */ + const char *name; /* Name to prefix messages */ + void *driverPrivate; /* Driver private area */ DevUnion *privates; /* Other privates can hook in * here */ DriverPtr drv; /* xf86DriverList[] entry */ - pointer module; /* Pointer to module head */ + void *module; /* Pointer to module head */ int colorKey; int overlayFlags; /* Some of these may be moved out of here into the driver private area */ - char *chipset; /* chipset name */ - char *ramdac; /* ramdac name */ - char *clockchip; /* clock name */ + const char *chipset; /* chipset name */ + const char *ramdac; /* ramdac name */ + const char *clockchip; /* clock name */ Bool progClock; /* clock is programmable */ int numClocks; /* number of clocks */ int clock[MAXCLOCKS]; /* list of clock frequencies */ @@ -754,7 +754,7 @@ typedef struct _ScrnInfoRec { int memClk; /* memory clock */ int textClockFreq; /* clock of text mode */ Bool flipPixels; /* swap default black/white */ - pointer options; + void *options; int chipID; int chipRev; @@ -779,7 +779,7 @@ typedef struct _ScrnInfoRec { int *entityInstanceList; struct pci_device *vgaDev; - pointer reservedPtr[NUM_RESERVED_POINTERS]; + void *reservedPtr[NUM_RESERVED_POINTERS]; /* * Driver entry points. @@ -864,7 +864,7 @@ typedef enum { typedef void (*DPMSSetProcPtr) (ScrnInfoPtr, int, int); /* Input handler proc */ -typedef void (*InputHandlerProc) (int fd, pointer data); +typedef void (*InputHandlerProc) (int fd, void *data); /* These are used by xf86GetClocks */ #define CLK_REG_SAVE -1 diff --git a/xorg-server/hw/xfree86/common/xf86vmode.c b/xorg-server/hw/xfree86/common/xf86vmode.c index cad0e6a21..2b07833ad 100644 --- a/xorg-server/hw/xfree86/common/xf86vmode.c +++ b/xorg-server/hw/xfree86/common/xf86vmode.c @@ -216,7 +216,7 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask) } static int -XF86VidModeFreeEvents(pointer value, XID id) +XF86VidModeFreeEvents(void *value, XID id) { XF86VidModeEventPtr pOld = (XF86VidModeEventPtr) value; ScreenPtr pScreen = pOld->screen; @@ -314,7 +314,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client) .type = X_Reply, .sequenceNumber = client->sequence }; - pointer mode; + void *mode; int dotClock; int ver; @@ -413,7 +413,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) { REQUEST(xXF86VidModeGetAllModeLinesReq); xXF86VidModeGetAllModeLinesReply rep; - pointer mode; + void *mode; int modecount, dotClock; int ver; @@ -524,7 +524,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client) xXF86OldVidModeAddModeLineReq *oldstuff = (xXF86OldVidModeAddModeLineReq *) client->requestBuffer; xXF86VidModeAddModeLineReq newstuff; - pointer mode; + void *mode; int len; int dotClock; int ver; @@ -688,7 +688,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) xXF86OldVidModeDeleteModeLineReq *oldstuff = (xXF86OldVidModeDeleteModeLineReq *) client->requestBuffer; xXF86VidModeDeleteModeLineReq newstuff; - pointer mode; + void *mode; int len, dotClock; int ver; @@ -813,7 +813,7 @@ ProcXF86VidModeModModeLine(ClientPtr client) xXF86OldVidModeModModeLineReq *oldstuff = (xXF86OldVidModeModModeLineReq *) client->requestBuffer; xXF86VidModeModModeLineReq newstuff; - pointer mode, modetmp; + void *mode, *modetmp; int len, dotClock; int ver; @@ -942,7 +942,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) (xXF86OldVidModeValidateModeLineReq *) client->requestBuffer; xXF86VidModeValidateModeLineReq newstuff; xXF86VidModeValidateModeLineReply rep; - pointer mode, modetmp = NULL; + void *mode, *modetmp = NULL; int len, status, dotClock; int ver; @@ -1080,7 +1080,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) xXF86OldVidModeSwitchToModeReq *oldstuff = (xXF86OldVidModeSwitchToModeReq *) client->requestBuffer; xXF86VidModeSwitchToModeReq newstuff; - pointer mode; + void *mode; int len, dotClock; int ver; @@ -1205,7 +1205,7 @@ ProcXF86VidModeGetMonitor(ClientPtr client) }; CARD32 *hsyncdata, *vsyncdata; int i, nHsync, nVrefresh; - pointer monitor; + void *monitor; DEBUG_P("XF86VidModeGetMonitor"); diff --git a/xorg-server/hw/xfree86/common/xf86xv.c b/xorg-server/hw/xfree86/common/xf86xv.c index 92d0f6da2..b16cb5df3 100644 --- a/xorg-server/hw/xfree86/common/xf86xv.c +++ b/xorg-server/hw/xfree86/common/xf86xv.c @@ -261,7 +261,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) sure that I appreciate that. */ ScreenPriv = malloc(sizeof(XF86XVScreenRec)); - pxvs->devPriv.ptr = (pointer) ScreenPriv; + pxvs->devPriv.ptr = (void *) ScreenPriv; if (!ScreenPriv) return FALSE; @@ -551,7 +551,7 @@ xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number) adaptorPriv->PutImage = adaptorPtr->PutImage; adaptorPriv->ReputImage = adaptorPtr->ReputImage; /* image/still */ - pa->devPriv.ptr = (pointer) adaptorPriv; + pa->devPriv.ptr = (void *) adaptorPriv; if (!(pPort = calloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { xf86XVFreeAdaptor(pa); @@ -957,7 +957,7 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) } static int -xf86XVReputAllVideo(WindowPtr pWin, pointer data) +xf86XVReputAllVideo(WindowPtr pWin, void *data) { XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); @@ -1922,7 +1922,7 @@ xf86XVFillKeyHelper(ScreenPtr pScreen, CARD32 key, RegionPtr fillboxes) } void -xf86XVFillKeyHelperPort(DrawablePtr pDraw, pointer data, CARD32 key, +xf86XVFillKeyHelperPort(DrawablePtr pDraw, void *data, CARD32 key, RegionPtr clipboxes, Bool fillEverything) { WindowPtr pWin = (WindowPtr) pDraw; diff --git a/xorg-server/hw/xfree86/common/xf86xv.h b/xorg-server/hw/xfree86/common/xf86xv.h index 091efcaa9..8986e2e57 100644 --- a/xorg-server/hw/xfree86/common/xf86xv.h +++ b/xorg-server/hw/xfree86/common/xf86xv.h @@ -84,47 +84,47 @@ typedef int (*PutVideoFuncPtr) (ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, - pointer data, DrawablePtr pDraw); + void *data, DrawablePtr pDraw); typedef int (*PutStillFuncPtr) (ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, - RegionPtr clipBoxes, pointer data, + RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef int (*GetVideoFuncPtr) (ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, - RegionPtr clipBoxes, pointer data, + RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef int (*GetStillFuncPtr) (ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, - RegionPtr clipBoxes, pointer data, + RegionPtr clipBoxes, void *data, DrawablePtr pDraw); -typedef void (*StopVideoFuncPtr) (ScrnInfoPtr pScrn, pointer data, Bool Exit); +typedef void (*StopVideoFuncPtr) (ScrnInfoPtr pScrn, void *data, Bool Exit); typedef int (*SetPortAttributeFuncPtr) (ScrnInfoPtr pScrn, Atom attribute, - INT32 value, pointer data); + INT32 value, void *data); typedef int (*GetPortAttributeFuncPtr) (ScrnInfoPtr pScrn, Atom attribute, - INT32 *value, pointer data); + INT32 *value, void *data); typedef void (*QueryBestSizeFuncPtr) (ScrnInfoPtr pScrn, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, - unsigned int *p_h, pointer data); + unsigned int *p_h, void *data); typedef int (*PutImageFuncPtr) (ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int image, unsigned char *buf, short width, short height, Bool Sync, RegionPtr clipBoxes, - pointer data, DrawablePtr pDraw); + void *data, DrawablePtr pDraw); typedef int (*ReputImageFuncPtr) (ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, - RegionPtr clipBoxes, pointer data, + RegionPtr clipBoxes, void *data, DrawablePtr pDraw); typedef int (*QueryImageAttributesFuncPtr) (ScrnInfoPtr pScrn, int image, unsigned short *width, unsigned short *height, int *pitches, int *offsets); -typedef void (*ClipNotifyFuncPtr) (ScrnInfoPtr pScrn, pointer data, +typedef void (*ClipNotifyFuncPtr) (ScrnInfoPtr pScrn, void *data, WindowPtr window, int dx, int dy); typedef enum { @@ -137,7 +137,7 @@ typedef enum { typedef struct { int id; - char *name; + const char *name; unsigned short width, height; XvRationalRec rate; } XF86VideoEncodingRec, *XF86VideoEncodingPtr; @@ -151,13 +151,13 @@ typedef struct { int flags; int min_value; int max_value; - char *name; + const char *name; } XF86AttributeRec, *XF86AttributePtr; typedef struct { unsigned int type; int flags; - char *name; + const char *name; int nEncodings; XF86VideoEncodingPtr pEncodings; int nFormats; @@ -238,7 +238,7 @@ xf86XVFillKeyHelperDrawable(DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes); extern _X_EXPORT void -xf86XVFillKeyHelperPort(DrawablePtr pDraw, pointer data, CARD32 key, +xf86XVFillKeyHelperPort(DrawablePtr pDraw, void *data, CARD32 key, RegionPtr clipboxes, Bool fillEverything); extern _X_EXPORT Bool diff --git a/xorg-server/hw/xfree86/common/xf86xvmc.h b/xorg-server/hw/xfree86/common/xf86xvmc.h index 2478fe344..aaa4e65f0 100644 --- a/xorg-server/hw/xfree86/common/xf86xvmc.h +++ b/xorg-server/hw/xfree86/common/xf86xvmc.h @@ -109,7 +109,7 @@ typedef void (*xf86XvMCDestroySubpictureProcPtr) (ScrnInfoPtr pScrn, XvMCSubpicturePtr subpicture); typedef struct { - char *name; + const char *name; int num_surfaces; XF86MCSurfaceInfoPtr *surfaces; int num_subpictures; diff --git a/xorg-server/hw/xfree86/ddc/ddc.c b/xorg-server/hw/xfree86/ddc/ddc.c index 44c1d535c..04d1a09c5 100644 --- a/xorg-server/hw/xfree86/ddc/ddc.c +++ b/xorg-server/hw/xfree86/ddc/ddc.c @@ -299,7 +299,7 @@ xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed, /* DDC2 */ static I2CDevPtr -DDC2MakeDevice(I2CBusPtr pBus, int address, char *name) +DDC2MakeDevice(I2CBusPtr pBus, int address, const char *name) { I2CDevPtr dev = NULL; diff --git a/xorg-server/hw/xfree86/dixmods/glxmodule.c b/xorg-server/hw/xfree86/dixmods/glxmodule.c index 133a2a65d..bf7d182a2 100644 --- a/xorg-server/hw/xfree86/dixmods/glxmodule.c +++ b/xorg-server/hw/xfree86/dixmods/glxmodule.c @@ -68,8 +68,8 @@ static XF86ModuleVersionInfo VersRec = { _X_EXPORT XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL }; -static pointer -glxSetup(pointer module, pointer opts, int *errmaj, int *errmin) +static void * +glxSetup(void *module, void *opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; __GLXprovider *provider; diff --git a/xorg-server/hw/xfree86/dri/dri.c b/xorg-server/hw/xfree86/dri/dri.c index 6292e87cc..38bfc1def 100644 --- a/xorg-server/hw/xfree86/dri/dri.c +++ b/xorg-server/hw/xfree86/dri/dri.c @@ -100,6 +100,11 @@ drmServerInfo DRIDRMServerInfo; * easily changed here. */ #define DRI_MSG_VERBOSITY 1 + +static void +DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...) + _X_ATTRIBUTE_PRINTF(3,4); + static void DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...) { @@ -400,7 +405,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) } DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] added %d byte SAREA at %p\n", - pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA); + (int) pDRIPriv->pDriverInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA); /* Backwards compat. */ if (drmMap(pDRIPriv->drmFD, @@ -414,7 +419,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) return FALSE; } DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n", - pDRIPriv->hSAREA, pDRIPriv->pSAREA); + (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); } else { @@ -442,7 +447,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) return FALSE; } DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n", - pDRIPriv->pDriverInfo->hFrameBuffer); + (void *) (uintptr_t) pDRIPriv->pDriverInfo->hFrameBuffer); } else { DRIDrvMsg(pScreen->myNum, X_INFO, @@ -513,7 +518,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) pDRIPriv->myContextPriv = pDRIContextPriv; DRIDrvMsg(pScreen->myNum, X_INFO, - "X context handle = %p\n", pDRIPriv->myContext); + "X context handle = %p\n", (void *) (uintptr_t) pDRIPriv->myContext); /* Now that we have created the X server's context, we can grab the * hardware lock for the X server. @@ -731,13 +736,13 @@ DRICloseScreen(ScreenPtr pScreen) if (closeMaster || pDRIPriv->hSAREA != pDRIEntPriv->hLSAREA) { DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] unmapping %d bytes of SAREA %p at %p\n", - pDRIInfo->SAREASize, pDRIPriv->hSAREA, pDRIPriv->pSAREA); + (int) pDRIInfo->SAREASize, (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[drm] unable to unmap %d bytes" " of SAREA %p at %p\n", - pDRIInfo->SAREASize, - pDRIPriv->hSAREA, pDRIPriv->pSAREA); + (int) pDRIInfo->SAREASize, + (void *) (uintptr_t) pDRIPriv->hSAREA, pDRIPriv->pSAREA); } } else { @@ -761,6 +766,10 @@ DRICloseScreen(ScreenPtr pScreen) static int dri_drm_debug_print(const char *format, va_list ap) + _X_ATTRIBUTE_PRINTF(1,0); + +static int +dri_drm_debug_print(const char *format, va_list ap) { xf86VDrvMsgVerb(-1, X_NONE, DRM_MSG_VERBOSITY, format, ap); return 0; @@ -1043,7 +1052,7 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual, } /* track this in case the client dies before cleanup */ - AddResource(context, DRIContextPrivResType, (pointer) pDRIContextPriv); + AddResource(context, DRIContextPrivResType, (void *) pDRIContextPriv); return TRUE; } @@ -1058,7 +1067,7 @@ DRIDestroyContext(ScreenPtr pScreen, XID context) /* DRIContextPrivDelete is called by the resource manager. */ Bool -DRIContextPrivDelete(pointer pResource, XID id) +DRIContextPrivDelete(void *pResource, XID id) { DRIContextPrivPtr pDRIContextPriv = (DRIContextPrivPtr) pResource; DRIScreenPrivPtr pDRIPriv; @@ -1141,7 +1150,7 @@ DRITransitionTo2d(ScreenPtr pScreen) } static int -DRIDCNTreeTraversal(WindowPtr pWin, pointer data) +DRIDCNTreeTraversal(WindowPtr pWin, void *data) { DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); @@ -1180,7 +1189,7 @@ DRIDriverClipNotify(ScreenPtr pScreen) if (pDRIPriv->nrWindows > 0) { pDRIPriv->nrWalked = 0; TraverseTree(pScreen->root, DRIDCNTreeTraversal, - (pointer) pDRIWindows); + (void *) pDRIWindows); } pDRIInfo->ClipNotify(pScreen, pDRIWindows, pDRIPriv->nrWindows); @@ -1275,7 +1284,7 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable, /* track this in case the client dies */ AddResource(FakeClientID(client->index), DRIDrawablePrivResType, - (pointer) (intptr_t) pDrawable->id); + (void *) (intptr_t) pDrawable->id); if (pDRIDrawablePriv->hwDrawable) { drmUpdateDrawableInfo(pDRIPriv->drmFD, @@ -1328,7 +1337,7 @@ DRIDrawablePrivDestroy(WindowPtr pWin) } static Bool -DRIDestroyDrawableCB(pointer value, XID id, pointer data) +DRIDestroyDrawableCB(void *value, XID id, void *data) { if (value == data) { /* This calls back DRIDrawablePrivDelete which frees private area */ @@ -1346,7 +1355,7 @@ DRIDestroyDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable) if (pDrawable->type == DRAWABLE_WINDOW) { LookupClientResourceComplex(client, DRIDrawablePrivResType, DRIDestroyDrawableCB, - (pointer) (intptr_t) pDrawable->id); + (void *) (intptr_t) pDrawable->id); } else { /* pixmap (or for GLX 1.3, a PBuffer) */ /* NOT_DONE */ @@ -1357,7 +1366,7 @@ DRIDestroyDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable) } Bool -DRIDrawablePrivDelete(pointer pResource, XID id) +DRIDrawablePrivDelete(void *pResource, XID id) { WindowPtr pWin; int rc; @@ -1616,7 +1625,7 @@ DRIDestroyInfoRec(DRIInfoPtr DRIInfo) } void -DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask) +DRIWakeupHandler(void *wakeupData, int result, void *pReadmask) { int i; @@ -1631,7 +1640,7 @@ DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask) } void -DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) +DRIBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask) { int i; @@ -1647,7 +1656,7 @@ DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) void DRIDoWakeupHandler(ScreenPtr pScreen, - unsigned long result, pointer pReadmask) + unsigned long result, void *pReadmask) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); @@ -1665,7 +1674,7 @@ DRIDoWakeupHandler(ScreenPtr pScreen, void DRIDoBlockHandler(ScreenPtr pScreen, - pointer pTimeout, pointer pReadmask) + void *pTimeout, void *pReadmask) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); @@ -1868,7 +1877,7 @@ DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg) } static int -DRITreeTraversal(WindowPtr pWin, pointer data) +DRITreeTraversal(WindowPtr pWin, void *data) { DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); @@ -1928,7 +1937,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) RegionNull(®); pDRIPriv->nrWalked = 0; - TraverseTree(pWin, DRITreeTraversal, (pointer) (®)); + TraverseTree(pWin, DRITreeTraversal, (void *) (®)); if (RegionNotEmpty(®)) { RegionTranslate(®, ptOldOrg.x - pWin->drawable.x, @@ -2214,9 +2223,9 @@ DRILock(ScreenPtr pScreen, int flags) else if (*pDRIPriv->pLockingContext != pDRIPriv->myContext) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[DRI] Locking deadlock.\n" - "\tAlready locked with context %d,\n" - "\ttrying to lock with context %d.\n", - pDRIPriv->pLockingContext, pDRIPriv->myContext); + "\tAlready locked with context %p,\n" + "\ttrying to lock with context %p.\n", + pDRIPriv->pLockingContext, (void *) (uintptr_t) pDRIPriv->myContext); } (*pDRIPriv->pLockRefCount)++; } @@ -2233,8 +2242,8 @@ DRIUnlock(ScreenPtr pScreen) if (pDRIPriv->myContext != *pDRIPriv->pLockingContext) { DRIDrvMsg(pScreen->myNum, X_ERROR, "[DRI] Unlocking inconsistency:\n" - "\tContext %d trying to unlock lock held by context %d\n", - pDRIPriv->pLockingContext, pDRIPriv->myContext); + "\tContext %p trying to unlock lock held by context %p\n", + pDRIPriv->pLockingContext, (void *) (uintptr_t) pDRIPriv->myContext); } (*pDRIPriv->pLockRefCount)--; } diff --git a/xorg-server/hw/xfree86/dri/dri.h b/xorg-server/hw/xfree86/dri/dri.h index 4bfaf1679..64cd7c9d4 100644 --- a/xorg-server/hw/xfree86/dri/dri.h +++ b/xorg-server/hw/xfree86/dri/dri.h @@ -151,7 +151,7 @@ typedef struct { int ddxDriverMajorVersion; int ddxDriverMinorVersion; int ddxDriverPatchVersion; - pointer frameBufferPhysicalAddress; + void *frameBufferPhysicalAddress; long frameBufferSize; long frameBufferStride; long SAREASize; @@ -224,7 +224,7 @@ extern _X_EXPORT Bool DRICreateContext(ScreenPtr pScreen, extern _X_EXPORT Bool DRIDestroyContext(ScreenPtr pScreen, XID context); -extern _X_EXPORT Bool DRIContextPrivDelete(pointer pResource, XID id); +extern _X_EXPORT Bool DRIContextPrivDelete(void *pResource, XID id); extern _X_EXPORT Bool DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, @@ -235,7 +235,7 @@ extern _X_EXPORT Bool DRIDestroyDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable); -extern _X_EXPORT Bool DRIDrawablePrivDelete(pointer pResource, XID id); +extern _X_EXPORT Bool DRIDrawablePrivDelete(void *pResource, XID id); extern _X_EXPORT Bool DRIGetDrawableInfo(ScreenPtr pScreen, DrawablePtr pDrawable, @@ -265,18 +265,18 @@ extern _X_EXPORT void DRIDestroyInfoRec(DRIInfoPtr DRIInfo); extern _X_EXPORT Bool DRIFinishScreenInit(ScreenPtr pScreen); -extern _X_EXPORT void DRIWakeupHandler(pointer wakeupData, - int result, pointer pReadmask); +extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, + int result, void *pReadmask); -extern _X_EXPORT void DRIBlockHandler(pointer blockData, - OSTimePtr pTimeout, pointer pReadmask); +extern _X_EXPORT void DRIBlockHandler(void *blockData, + OSTimePtr pTimeout, void *pReadmask); extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, unsigned long result, - pointer pReadmask); + void *pReadmask); extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, - pointer pTimeout, pointer pReadmask); + void *pTimeout, void *pReadmask); extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx); diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index 0b047f025..729a323da 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -354,7 +354,7 @@ DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id, } static int -DRI2DrawableGone(pointer p, XID id) +DRI2DrawableGone(void *p, XID id) { DRI2DrawablePtr pPriv = p; DRI2DrawableRefPtr ref, next; @@ -754,7 +754,7 @@ static inline PixmapPtr GetDrawablePixmap(DrawablePtr drawable) * pixmap */ static int -DRI2InvalidateWalk(WindowPtr pWin, pointer data) +DRI2InvalidateWalk(WindowPtr pWin, void *data) { if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data) return WT_DONTWALKCHILDREN; @@ -1563,8 +1563,6 @@ DRI2CloseScreen(ScreenPtr pScreen) dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL); } -extern Bool DRI2ModuleSetup(void); - /* Called by InitExtensions() */ Bool DRI2ModuleSetup(void) diff --git a/xorg-server/hw/xfree86/exa/examodule.c b/xorg-server/hw/xfree86/exa/examodule.c index 4e809ea37..76f780ab6 100644 --- a/xorg-server/hw/xfree86/exa/examodule.c +++ b/xorg-server/hw/xfree86/exa/examodule.c @@ -128,7 +128,7 @@ exaDDXDriverInit(ScreenPtr pScreen) if (pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) { if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS) && pExaScr->info->offScreenBase < pExaScr->info->memorySize) { - char *heuristicName; + const char *heuristicName; heuristicName = xf86GetOptValString(pScreenPriv->options, EXAOPT_MIGRATION_HEURISTIC); diff --git a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c b/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c index cbb40930b..0450822ee 100644 --- a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c +++ b/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c @@ -81,15 +81,13 @@ typedef struct { Bool fbdevHWGetRec(ScrnInfoPtr pScrn) { - fbdevHWPtr fPtr; - if (fbdevHWPrivateIndex < 0) fbdevHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); if (FBDEVHWPTR(pScrn) != NULL) return TRUE; - fPtr = FBDEVHWPTRLVAL(pScrn) = xnfcalloc(sizeof(fbdevHWRec), 1); + FBDEVHWPTRLVAL(pScrn) = xnfcalloc(sizeof(fbdevHWRec), 1); return TRUE; } @@ -301,7 +299,7 @@ fbdev_open_pci(struct pci_device *pPci, char **namep) } static int -fbdev_open(int scrnIndex, char *dev, char **namep) +fbdev_open(int scrnIndex, const char *dev, char **namep) { struct fb_fix_screeninfo fix; int fd; @@ -497,7 +495,7 @@ fbdevHWSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool check) void fbdevHWSetVideoModes(ScrnInfoPtr pScrn) { - char **modename; + const char **modename; DisplayModePtr mode, this, last = pScrn->modes; if (NULL == pScrn->display->modes) diff --git a/xorg-server/hw/xfree86/i2c/bt829.c b/xorg-server/hw/xfree86/i2c/bt829.c index 070cb2044..991c26eab 100644 --- a/xorg-server/hw/xfree86/i2c/bt829.c +++ b/xorg-server/hw/xfree86/i2c/bt829.c @@ -500,6 +500,7 @@ bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr) { BT829Ptr bt; I2CByte a; + char *devname; bt = calloc(1, sizeof(BT829Rec)); if (bt == NULL) @@ -520,31 +521,31 @@ bt829_Detect(I2CBusPtr b, I2CSlaveAddr addr) bt->id = btread(bt, IDCODE); - free(bt->d.DevName); - bt->d.DevName = calloc(200, sizeof(char)); + free((void *) bt->d.DevName); + bt->d.DevName = devname = calloc(200, sizeof(char)); switch (BTVERSION) { case BT815: - sprintf(bt->d.DevName, "bt815a video decoder, revision %d", + sprintf(devname, "bt815a video decoder, revision %d", bt->id & 0xf); break; case BT817: - sprintf(bt->d.DevName, "bt817a video decoder, revision %d", + sprintf(devname, "bt817a video decoder, revision %d", bt->id & 0xf); break; case BT819: - sprintf(bt->d.DevName, "bt819a video decoder, revision %d", + sprintf(devname, "bt819a video decoder, revision %d", bt->id & 0xf); break; case BT827: - sprintf(bt->d.DevName, "bt827a/b video decoder, revision %d", + sprintf(devname, "bt827a/b video decoder, revision %d", bt->id & 0xf); break; case BT829: - sprintf(bt->d.DevName, "bt829a/b video decoder, revision %d", + sprintf(devname, "bt829a/b video decoder, revision %d", bt->id & 0xf); break; default: - sprintf(bt->d.DevName, + sprintf(devname, "bt8xx/unknown video decoder version %d, revision %d", bt->id >> 4, bt->id & 0xf); break; diff --git a/xorg-server/hw/xfree86/i2c/fi1236.c b/xorg-server/hw/xfree86/i2c/fi1236.c index 2eb27ba6d..ebd14547d 100644 --- a/xorg-server/hw/xfree86/i2c/fi1236.c +++ b/xorg-server/hw/xfree86/i2c/fi1236.c @@ -545,7 +545,7 @@ FI1236_set_tuner_type(FI1236Ptr f, int type) } static CARD32 -AFC_TimerCallback(OsTimerPtr timer, CARD32 time, pointer data) +AFC_TimerCallback(OsTimerPtr timer, CARD32 time, void *data) { FI1236Ptr f = (FI1236Ptr) data; diff --git a/xorg-server/hw/xfree86/i2c/msp3430.c b/xorg-server/hw/xfree86/i2c/msp3430.c index 312a2d1d1..a501489ee 100644 --- a/xorg-server/hw/xfree86/i2c/msp3430.c +++ b/xorg-server/hw/xfree86/i2c/msp3430.c @@ -163,7 +163,7 @@ DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr) m->d.ByteTimeout = b->ByteTimeout; if (!I2C_WriteRead(&(m->d), NULL, 0, &a, 1)) { - free(m->d.DevName); + free((void *) m->d.DevName); free(m); return NULL; } @@ -250,12 +250,12 @@ DetectMSP3430(I2CBusPtr b, I2CSlaveAddr addr) supported ? "" : " (unsupported)", rom_version, m->chip_id); if (!supported) { - free(m->d.DevName); + free((void *) m->d.DevName); free(m); return NULL; } if (!I2CDevInit(&(m->d))) { - free(m->d.DevName); + free((void *) m->d.DevName); free(m); return NULL; } diff --git a/xorg-server/hw/xfree86/i2c/xf86i2c.h b/xorg-server/hw/xfree86/i2c/xf86i2c.h index e296d7d81..26303ff6f 100644 --- a/xorg-server/hw/xfree86/i2c/xf86i2c.h +++ b/xorg-server/hw/xfree86/i2c/xf86i2c.h @@ -66,7 +66,7 @@ extern _X_EXPORT int xf86I2CGetScreenBuses(int scrnIndex, /* I2C slave devices */ typedef struct _I2CDevRec { - char *DevName; + const char *DevName; int BitTimeout; /* usec */ int ByteTimeout; /* usec */ diff --git a/xorg-server/hw/xfree86/int10/generic.c b/xorg-server/hw/xfree86/int10/generic.c index d7594def2..abbd36f3c 100644 --- a/xorg-server/hw/xfree86/int10/generic.c +++ b/xorg-server/hw/xfree86/int10/generic.c @@ -20,12 +20,12 @@ #define ALLOC_ENTRIES(x) ((V_RAM / x) - 1) -static CARD8 read_b(xf86Int10InfoPtr pInt, int addr); -static CARD16 read_w(xf86Int10InfoPtr pInt, int addr); -static CARD32 read_l(xf86Int10InfoPtr pInt, int addr); -static void write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val); -static void write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val); -static void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val); +static uint8_t read_b(xf86Int10InfoPtr pInt, int addr); +static uint16_t read_w(xf86Int10InfoPtr pInt, int addr); +static uint32_t read_l(xf86Int10InfoPtr pInt, int addr); +static void write_b(xf86Int10InfoPtr pInt, int addr, uint8_t val); +static void write_w(xf86Int10InfoPtr pInt, int addr, uint16_t val); +static void write_l(xf86Int10InfoPtr pInt, int addr, uint32_t val); /* * the emulator cannot pass a pointer to the current xf86Int10InfoRec @@ -87,8 +87,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) if (!xf86Int10ExecSetup(pInt)) goto error0; pInt->mem = &genericMem; - pInt->private = (pointer) xnfcalloc(1, sizeof(genericInt10Priv)); - INTPriv(pInt)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(getpagesize())); + pInt->private = (void *) xnfcalloc(1, sizeof(genericInt10Priv)); + INTPriv(pInt)->alloc = (void *) xnfcalloc(1, ALLOC_ENTRIES(getpagesize())); pInt->pScrn = pScrn; base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS); @@ -339,39 +339,39 @@ xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num) #define VRAM(addr) ((addr >= V_RAM) && (addr < (V_RAM + VRAM_SIZE))) #define V_ADDR_RB(addr) \ - (VRAM(addr)) ? MMIO_IN8((CARD8*)VRAM_BASE,VRAM_ADDR(addr)) \ - : *(CARD8*) V_ADDR(addr) + (VRAM(addr)) ? MMIO_IN8((uint8_t*)VRAM_BASE,VRAM_ADDR(addr)) \ + : *(uint8_t*) V_ADDR(addr) #define V_ADDR_RW(addr) \ - (VRAM(addr)) ? MMIO_IN16((CARD16*)VRAM_BASE,VRAM_ADDR(addr)) \ - : ldw_u((pointer)V_ADDR(addr)) + (VRAM(addr)) ? MMIO_IN16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr)) \ + : ldw_u((void *)V_ADDR(addr)) #define V_ADDR_RL(addr) \ - (VRAM(addr)) ? MMIO_IN32((CARD32*)VRAM_BASE,VRAM_ADDR(addr)) \ - : ldl_u((pointer)V_ADDR(addr)) + (VRAM(addr)) ? MMIO_IN32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr)) \ + : ldl_u((void *)V_ADDR(addr)) #define V_ADDR_WB(addr,val) \ if(VRAM(addr)) \ - MMIO_OUT8((CARD8*)VRAM_BASE,VRAM_ADDR(addr),val); \ + MMIO_OUT8((uint8_t*)VRAM_BASE,VRAM_ADDR(addr),val); \ else \ - *(CARD8*) V_ADDR(addr) = val; + *(uint8_t*) V_ADDR(addr) = val; #define V_ADDR_WW(addr,val) \ if(VRAM(addr)) \ - MMIO_OUT16((CARD16*)VRAM_BASE,VRAM_ADDR(addr),val); \ + MMIO_OUT16((uint16_t*)VRAM_BASE,VRAM_ADDR(addr),val); \ else \ - stw_u((val),(pointer)(V_ADDR(addr))); + stw_u((val),(void *)(V_ADDR(addr))); #define V_ADDR_WL(addr,val) \ if (VRAM(addr)) \ - MMIO_OUT32((CARD32*)VRAM_BASE,VRAM_ADDR(addr),val); \ + MMIO_OUT32((uint32_t*)VRAM_BASE,VRAM_ADDR(addr),val); \ else \ - stl_u(val,(pointer)(V_ADDR(addr))); + stl_u(val,(void *)(V_ADDR(addr))); -static CARD8 +static uint8_t read_b(xf86Int10InfoPtr pInt, int addr) { return V_ADDR_RB(addr); } -static CARD16 +static uint16_t read_w(xf86Int10InfoPtr pInt, int addr) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN @@ -381,7 +381,7 @@ read_w(xf86Int10InfoPtr pInt, int addr) return V_ADDR_RB(addr) | (V_ADDR_RB(addr + 1) << 8); } -static CARD32 +static uint32_t read_l(xf86Int10InfoPtr pInt, int addr) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN @@ -394,7 +394,7 @@ read_l(xf86Int10InfoPtr pInt, int addr) } static void -write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val) +write_b(xf86Int10InfoPtr pInt, int addr, uint8_t val) { V_ADDR_WB(addr, val); } @@ -412,7 +412,7 @@ write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val) } static void -write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val) +write_l(xf86Int10InfoPtr pInt, int addr, uint32_t val) { #if X_BYTE_ORDER == X_LITTLE_ENDIAN if (OFF(addr + 3) > 2) { @@ -425,8 +425,8 @@ write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val) V_ADDR_WB(addr + 3, val >> 24); } -pointer -xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr) +void * +xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr) { return V_ADDR(addr); } diff --git a/xorg-server/hw/xfree86/int10/helper_exec.c b/xorg-server/hw/xfree86/int10/helper_exec.c index 1c58cf7ae..6a83f422e 100644 --- a/xorg-server/hw/xfree86/int10/helper_exec.c +++ b/xorg-server/hw/xfree86/int10/helper_exec.c @@ -37,12 +37,12 @@ #endif #include <pciaccess.h> -static int pciCfg1in(CARD16 addr, CARD32 *val); -static int pciCfg1out(CARD16 addr, CARD32 val); -static int pciCfg1inw(CARD16 addr, CARD16 *val); -static int pciCfg1outw(CARD16 addr, CARD16 val); -static int pciCfg1inb(CARD16 addr, CARD8 *val); -static int pciCfg1outb(CARD16 addr, CARD8 val); +static int pciCfg1in(uint16_t addr, uint32_t *val); +static int pciCfg1out(uint16_t addr, uint32_t val); +static int pciCfg1inw(uint16_t addr, uint16_t *val); +static int pciCfg1outw(uint16_t addr, uint16_t val); +static int pciCfg1inb(uint16_t addr, uint8_t *val); +static int pciCfg1outb(uint16_t addr, uint8_t val); #if defined (_PC) static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set); @@ -58,13 +58,13 @@ setup_int(xf86Int10InfoPtr pInt) return -1; Int10Current = pInt; } - X86_EAX = (CARD32) pInt->ax; - X86_EBX = (CARD32) pInt->bx; - X86_ECX = (CARD32) pInt->cx; - X86_EDX = (CARD32) pInt->dx; - X86_ESI = (CARD32) pInt->si; - X86_EDI = (CARD32) pInt->di; - X86_EBP = (CARD32) pInt->bp; + X86_EAX = (uint32_t) pInt->ax; + X86_EBX = (uint32_t) pInt->bx; + X86_ECX = (uint32_t) pInt->cx; + X86_EDX = (uint32_t) pInt->dx; + X86_ESI = (uint32_t) pInt->si; + X86_EDI = (uint32_t) pInt->di; + X86_EBP = (uint32_t) pInt->bp; X86_ESP = 0x1000; X86_SS = pInt->stackseg >> 4; X86_EIP = 0x0600; @@ -86,15 +86,15 @@ void finish_int(xf86Int10InfoPtr pInt, int sig) { OsReleaseSignals(); - pInt->ax = (CARD32) X86_EAX; - pInt->bx = (CARD32) X86_EBX; - pInt->cx = (CARD32) X86_ECX; - pInt->dx = (CARD32) X86_EDX; - pInt->si = (CARD32) X86_ESI; - pInt->di = (CARD32) X86_EDI; - pInt->es = (CARD16) X86_ES; - pInt->bp = (CARD32) X86_EBP; - pInt->flags = (CARD32) X86_FLAGS; + pInt->ax = (uint32_t) X86_EAX; + pInt->bx = (uint32_t) X86_EBX; + pInt->cx = (uint32_t) X86_ECX; + pInt->dx = (uint32_t) X86_EDX; + pInt->si = (uint32_t) X86_ESI; + pInt->di = (uint32_t) X86_EDI; + pInt->es = (uint16_t) X86_ES; + pInt->bp = (uint32_t) X86_EBP; + pInt->flags = (uint32_t) X86_FLAGS; #if defined (_PC) if (pInt->Flags & RESTORE_BIOS_SCRATCH) SetResetBIOSVars(pInt, FALSE); @@ -102,23 +102,23 @@ finish_int(xf86Int10InfoPtr pInt, int sig) } /* general software interrupt handler */ -CARD32 +uint32_t getIntVect(xf86Int10InfoPtr pInt, int num) { return MEM_RW(pInt, num << 2) + (MEM_RW(pInt, (num << 2) + 2) << 4); } void -pushw(xf86Int10InfoPtr pInt, CARD16 val) +pushw(xf86Int10InfoPtr pInt, uint16_t val) { X86_ESP -= 2; - MEM_WW(pInt, ((CARD32) X86_SS << 4) + X86_SP, val); + MEM_WW(pInt, ((uint32_t) X86_SS << 4) + X86_SP, val); } int run_bios_int(int num, xf86Int10InfoPtr pInt) { - CARD32 eflags; + uint32_t eflags; #ifndef _PC /* check if bios vector is initialized */ @@ -167,10 +167,10 @@ void dump_code(xf86Int10InfoPtr pInt) { int i; - CARD32 lina = SEG_ADR((CARD32), X86_CS, IP); + uint32_t lina = SEG_ADR((uint32_t), X86_CS, IP); xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", - lina); + (unsigned) lina); for (i = 0; i < 0x10; i++) xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i)); xf86ErrorFVerb(3, "\n"); @@ -203,8 +203,8 @@ void stack_trace(xf86Int10InfoPtr pInt) { int i = 0; - unsigned long stack = SEG_ADR((CARD32), X86_SS, SP); - unsigned long tail = (CARD32) ((X86_SS << 4) + 0x1000); + unsigned long stack = SEG_ADR((uint32_t), X86_SS, SP); + unsigned long tail = (uint32_t) ((X86_SS << 4) + 0x1000); if (stack >= tail) return; @@ -222,14 +222,14 @@ stack_trace(xf86Int10InfoPtr pInt) int port_rep_inb(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count) + uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -1 : 1; - CARD32 dst = base; + uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_insb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", - port, count, base, d_f ? "up" : "down"); + port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { MEM_WB(pInt, dst, x_inb(port)); dst += inc; @@ -239,14 +239,14 @@ port_rep_inb(xf86Int10InfoPtr pInt, int port_rep_inw(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count) + uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -2 : 2; - CARD32 dst = base; + uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_insw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", - port, count, base, d_f ? "up" : "down"); + port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { MEM_WW(pInt, dst, x_inw(port)); dst += inc; @@ -256,14 +256,14 @@ port_rep_inw(xf86Int10InfoPtr pInt, int port_rep_inl(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count) + uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -4 : 4; - CARD32 dst = base; + uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_insl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", - port, count, base, d_f ? "up" : "down"); + port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { MEM_WL(pInt, dst, x_inl(port)); dst += inc; @@ -273,14 +273,14 @@ port_rep_inl(xf86Int10InfoPtr pInt, int port_rep_outb(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count) + uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -1 : 1; - CARD32 dst = base; + uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_outb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", - port, count, base, d_f ? "up" : "down"); + port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { x_outb(port, MEM_RB(pInt, dst)); dst += inc; @@ -290,14 +290,14 @@ port_rep_outb(xf86Int10InfoPtr pInt, int port_rep_outw(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count) + uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -2 : 2; - CARD32 dst = base; + uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_outw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", - port, count, base, d_f ? "up" : "down"); + port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { x_outw(port, MEM_RW(pInt, dst)); dst += inc; @@ -307,14 +307,14 @@ port_rep_outw(xf86Int10InfoPtr pInt, int port_rep_outl(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count) + uint16_t port, uint32_t base, int d_f, uint32_t count) { register int inc = d_f ? -4 : 4; - CARD32 dst = base; + uint32_t dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" rep_outl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", - port, count, base, d_f ? "up" : "down"); + port, (unsigned) count, (unsigned) base, d_f ? "up" : "down"); while (count--) { x_outl(port, MEM_RL(pInt, dst)); dst += inc; @@ -322,14 +322,14 @@ port_rep_outl(xf86Int10InfoPtr pInt, return dst - base; } -CARD8 -x_inb(CARD16 port) +uint8_t +x_inb(uint16_t port) { - CARD8 val; + uint8_t val; if (port == 0x40) { Int10Current->inb40time++; - val = (CARD8) (Int10Current->inb40time >> + val = (uint8_t) (Int10Current->inb40time >> ((Int10Current->inb40time & 1) << 3)); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" inb(%#x) = %2.2x\n", port, val); @@ -353,10 +353,10 @@ x_inb(CARD16 port) return val; } -CARD16 -x_inw(CARD16 port) +uint16_t +x_inw(uint16_t port) { - CARD16 val; + uint16_t val; if (port == 0x5c) { struct timeval tv; @@ -366,7 +366,7 @@ x_inw(CARD16 port) * Approximate this by dividing by 3. */ X_GETTIMEOFDAY(&tv); - val = (CARD16) (tv.tv_usec / 3); + val = (uint16_t) (tv.tv_usec / 3); } else if (!pciCfg1inw(port, &val)) { val = pci_io_read16(Int10Current->io, port); @@ -377,7 +377,7 @@ x_inw(CARD16 port) } void -x_outb(CARD16 port, CARD8 val) +x_outb(uint16_t port, uint8_t val) { if ((port == 0x43) && (val == 0)) { struct timeval tv; @@ -389,7 +389,7 @@ x_outb(CARD16 port, CARD8 val) * the bottom bit as a byte select. See inb(0x40) above. */ X_GETTIMEOFDAY(&tv); - Int10Current->inb40time = (CARD16) (tv.tv_usec | 1); + Int10Current->inb40time = (uint16_t) (tv.tv_usec | 1); if (PRINT_PORT && DEBUG_IO_TRACE()) ErrorF(" outb(%#x, %2.2x)\n", port, val); #ifdef __NOT_YET__ @@ -411,7 +411,7 @@ x_outb(CARD16 port, CARD8 val) } void -x_outw(CARD16 port, CARD16 val) +x_outw(uint16_t port, uint16_t val) { if (!pciCfg1outw(port, val)) { @@ -421,66 +421,66 @@ x_outw(CARD16 port, CARD16 val) } } -CARD32 -x_inl(CARD16 port) +uint32_t +x_inl(uint16_t port) { - CARD32 val; + uint32_t val; if (!pciCfg1in(port, &val)) { val = pci_io_read32(Int10Current->io, port); if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, val); + ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, (unsigned) val); } return val; } void -x_outl(CARD16 port, CARD32 val) +x_outl(uint16_t port, uint32_t val) { if (!pciCfg1out(port, val)) { if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, val); + ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, (unsigned) val); pci_io_write32(Int10Current->io, port, val); } } -CARD8 -Mem_rb(CARD32 addr) +uint8_t +Mem_rb(uint32_t addr) { return (*Int10Current->mem->rb) (Int10Current, addr); } -CARD16 -Mem_rw(CARD32 addr) +uint16_t +Mem_rw(uint32_t addr) { return (*Int10Current->mem->rw) (Int10Current, addr); } -CARD32 -Mem_rl(CARD32 addr) +uint32_t +Mem_rl(uint32_t addr) { return (*Int10Current->mem->rl) (Int10Current, addr); } void -Mem_wb(CARD32 addr, CARD8 val) +Mem_wb(uint32_t addr, uint8_t val) { (*Int10Current->mem->wb) (Int10Current, addr, val); } void -Mem_ww(CARD32 addr, CARD16 val) +Mem_ww(uint32_t addr, uint16_t val) { (*Int10Current->mem->ww) (Int10Current, addr, val); } void -Mem_wl(CARD32 addr, CARD32 val) +Mem_wl(uint32_t addr, uint32_t val) { (*Int10Current->mem->wl) (Int10Current, addr, val); } -static CARD32 PciCfg1Addr = 0; +static uint32_t PciCfg1Addr = 0; #define PCI_DOM_FROM_TAG(tag) (((tag) >> 24) & (PCI_DOM_MASK)) #define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK)) @@ -491,10 +491,10 @@ static CARD32 PciCfg1Addr = 0; #define PCI_TAG(x) ((x) & 0x7fffff00) static struct pci_device * -pci_device_for_cfg_address(CARD32 addr) +pci_device_for_cfg_address(uint32_t addr) { struct pci_device *dev = NULL; - CARD32 tag = PCI_TAG(addr); + uint32_t tag = PCI_TAG(addr); struct pci_slot_match slot_match = { .domain = PCI_DOM_FROM_TAG(tag), @@ -516,7 +516,7 @@ pci_device_for_cfg_address(CARD32 addr) } static int -pciCfg1in(CARD16 addr, CARD32 *val) +pciCfg1in(uint16_t addr, uint32_t *val) { if (addr == 0xCF8) { *val = PciCfg1Addr; @@ -526,15 +526,15 @@ pciCfg1in(CARD16 addr, CARD32 *val) pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr), (uint32_t *) val, PCI_OFFSET(PciCfg1Addr)); if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_inl(%#" PRIx32 ") = %8.8" PRIx32 "\n", PciCfg1Addr, - *val); + ErrorF(" cfg_inl(%#" PRIx32 ") = %8.8" PRIx32 "\n", (unsigned) PciCfg1Addr, + (unsigned) *val); return 1; } return 0; } static int -pciCfg1out(CARD16 addr, CARD32 val) +pciCfg1out(uint16_t addr, uint32_t val) { if (addr == 0xCF8) { PciCfg1Addr = val; @@ -542,8 +542,8 @@ pciCfg1out(CARD16 addr, CARD32 val) } if (addr == 0xCFC) { if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_outl(%#" PRIx32 ", %8.8" PRIx32 ")\n", PciCfg1Addr, - val); + ErrorF(" cfg_outl(%#" PRIx32 ", %8.8" PRIx32 ")\n", (unsigned) PciCfg1Addr, + (unsigned) val); pci_device_cfg_write_u32(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr)); return 1; @@ -552,7 +552,7 @@ pciCfg1out(CARD16 addr, CARD32 val) } static int -pciCfg1inw(CARD16 addr, CARD16 *val) +pciCfg1inw(uint16_t addr, uint16_t *val) { int shift; @@ -567,30 +567,30 @@ pciCfg1inw(CARD16 addr, CARD16 *val) pci_device_cfg_read_u16(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_inw(%#" PRIx32 ") = %4.4x\n", PciCfg1Addr + offset, - *val); + ErrorF(" cfg_inw(%#" PRIx32 ") = %4.4x\n", (unsigned) (PciCfg1Addr + offset), + (unsigned) *val); return 1; } return 0; } static int -pciCfg1outw(CARD16 addr, CARD16 val) +pciCfg1outw(uint16_t addr, uint16_t val) { int shift; if ((addr >= 0xCF8) && (addr <= 0xCFB)) { shift = (addr - 0xCF8) * 8; PciCfg1Addr &= ~(0xffff << shift); - PciCfg1Addr |= ((CARD32) val) << shift; + PciCfg1Addr |= ((uint32_t) val) << shift; return 1; } if ((addr >= 0xCFC) && (addr <= 0xCFF)) { const unsigned offset = addr - 0xCFC; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_outw(%#" PRIx32 ", %4.4x)\n", PciCfg1Addr + offset, - val); + ErrorF(" cfg_outw(%#" PRIx32 ", %4.4x)\n", (unsigned) (PciCfg1Addr + offset), + (unsigned) val); pci_device_cfg_write_u16(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); return 1; @@ -599,7 +599,7 @@ pciCfg1outw(CARD16 addr, CARD16 val) } static int -pciCfg1inb(CARD16 addr, CARD8 *val) +pciCfg1inb(uint16_t addr, uint8_t *val) { int shift; @@ -614,30 +614,30 @@ pciCfg1inb(CARD16 addr, CARD8 *val) pci_device_cfg_read_u8(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_inb(%#" PRIx32 ") = %2.2x\n", PciCfg1Addr + offset, - *val); + ErrorF(" cfg_inb(%#" PRIx32 ") = %2.2x\n", (unsigned) (PciCfg1Addr + offset), + (unsigned) *val); return 1; } return 0; } static int -pciCfg1outb(CARD16 addr, CARD8 val) +pciCfg1outb(uint16_t addr, uint8_t val) { int shift; if ((addr >= 0xCF8) && (addr <= 0xCFB)) { shift = (addr - 0xCF8) * 8; PciCfg1Addr &= ~(0xff << shift); - PciCfg1Addr |= ((CARD32) val) << shift; + PciCfg1Addr |= ((uint32_t) val) << shift; return 1; } if ((addr >= 0xCFC) && (addr <= 0xCFF)) { const unsigned offset = addr - 0xCFC; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_outb(%#" PRIx32 ", %2.2x)\n", PciCfg1Addr + offset, - val); + ErrorF(" cfg_outb(%#" PRIx32 ", %2.2x)\n", (unsigned) (PciCfg1Addr + offset), + (unsigned) val); pci_device_cfg_write_u8(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); return 1; @@ -645,10 +645,10 @@ pciCfg1outb(CARD16 addr, CARD8 val) return 0; } -CARD8 -bios_checksum(const CARD8 *start, int size) +uint8_t +bios_checksum(const uint8_t *start, int size) { - CARD8 sum = 0; + uint8_t sum = 0; while (size-- > 0) sum += *start++; @@ -682,12 +682,12 @@ LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga) vga->save_46e8 = pci_io_read8(pInt->io, 0x46E8); #endif vga->save_pos102 = pci_io_read8(pInt->io, 0x0102); - pci_io_write8(pInt->io, 0x03C2, ~(CARD8) 0x03 & vga->save_msr); - pci_io_write8(pInt->io, 0x03C3, ~(CARD8) 0x01 & vga->save_vse); + pci_io_write8(pInt->io, 0x03C2, ~(uint8_t) 0x03 & vga->save_msr); + pci_io_write8(pInt->io, 0x03C3, ~(uint8_t) 0x01 & vga->save_vse); #ifndef __ia64__ - pci_io_write8(pInt->io, 0x46E8, ~(CARD8) 0x08 & vga->save_46e8); + pci_io_write8(pInt->io, 0x46E8, ~(uint8_t) 0x08 & vga->save_46e8); #endif - pci_io_write8(pInt->io, 0x0102, ~(CARD8) 0x01 & vga->save_pos102); + pci_io_write8(pInt->io, 0x0102, ~(uint8_t) 0x01 & vga->save_pos102); } void diff --git a/xorg-server/hw/xfree86/int10/helper_mem.c b/xorg-server/hw/xfree86/int10/helper_mem.c index 160c5aedf..1b5960e0c 100644 --- a/xorg-server/hw/xfree86/int10/helper_mem.c +++ b/xorg-server/hw/xfree86/int10/helper_mem.c @@ -199,7 +199,7 @@ xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex) OptionInfoPtr options = NULL; if (pEnt->device) { - pointer configOptions = NULL; + void *configOptions = NULL; /* Check if xf86CollectOptions() has already been called */ if (((pEnt->index < 0) || diff --git a/xorg-server/hw/xfree86/int10/stub.c b/xorg-server/hw/xfree86/int10/stub.c index 8fd079069..40e0ba719 100644 --- a/xorg-server/hw/xfree86/int10/stub.c +++ b/xorg-server/hw/xfree86/int10/stub.c @@ -62,7 +62,7 @@ xf86ExecX86int10(xf86Int10InfoPtr pInt) return; } -pointer +void * xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr) { return 0; diff --git a/xorg-server/hw/xfree86/int10/xf86int10.h b/xorg-server/hw/xfree86/int10/xf86int10.h index 6d564fc1a..83bab7e61 100644 --- a/xorg-server/hw/xfree86/int10/xf86int10.h +++ b/xorg-server/hw/xfree86/int10/xf86int10.h @@ -21,13 +21,13 @@ /* int10 info structure */ typedef struct { int entityIndex; - CARD16 BIOSseg; - CARD16 inb40time; + uint16_t BIOSseg; + uint16_t inb40time; ScrnInfoPtr pScrn; - pointer cpuRegs; + void *cpuRegs; char *BIOSScratch; int Flags; - pointer private; + void *private; struct _int10Mem *mem; int num; int ax; @@ -45,19 +45,19 @@ typedef struct { } xf86Int10InfoRec, *xf86Int10InfoPtr; typedef struct _int10Mem { - CARD8 (*rb) (xf86Int10InfoPtr, int); - CARD16 (*rw) (xf86Int10InfoPtr, int); - CARD32 (*rl) (xf86Int10InfoPtr, int); - void (*wb) (xf86Int10InfoPtr, int, CARD8); - void (*ww) (xf86Int10InfoPtr, int, CARD16); - void (*wl) (xf86Int10InfoPtr, int, CARD32); + uint8_t (*rb) (xf86Int10InfoPtr, int); + uint16_t (*rw) (xf86Int10InfoPtr, int); + uint32_t (*rl) (xf86Int10InfoPtr, int); + void (*wb) (xf86Int10InfoPtr, int, uint8_t); + void (*ww) (xf86Int10InfoPtr, int, uint16_t); + void (*wl) (xf86Int10InfoPtr, int, uint32_t); } int10MemRec, *int10MemPtr; typedef struct { - CARD8 save_msr; - CARD8 save_pos102; - CARD8 save_vse; - CARD8 save_46e8; + uint8_t save_msr; + uint8_t save_pos102; + uint8_t save_vse; + uint8_t save_46e8; } legacyVGARec, *legacyVGAPtr; /* OS dependent functions */ @@ -69,7 +69,7 @@ extern _X_EXPORT void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off); extern _X_EXPORT void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num); -extern _X_EXPORT pointer xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr); +extern _X_EXPORT void *xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr); /* x86 executor related functions */ extern _X_EXPORT void xf86ExecX86int10(xf86Int10InfoPtr pInt); @@ -127,13 +127,13 @@ int int_handler(xf86Int10InfoPtr pInt); /* helper_exec.c */ int setup_int(xf86Int10InfoPtr pInt); void finish_int(xf86Int10InfoPtr, int sig); -CARD32 getIntVect(xf86Int10InfoPtr pInt, int num); -void pushw(xf86Int10InfoPtr pInt, CARD16 val); +uint32_t getIntVect(xf86Int10InfoPtr pInt, int num); +void pushw(xf86Int10InfoPtr pInt, uint16_t val); int run_bios_int(int num, xf86Int10InfoPtr pInt); void dump_code(xf86Int10InfoPtr pInt); void dump_registers(xf86Int10InfoPtr pInt); void stack_trace(xf86Int10InfoPtr pInt); -CARD8 bios_checksum(const CARD8 *start, int size); +uint8_t bios_checksum(const uint8_t *start, int size); void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga); void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga); @@ -142,31 +142,31 @@ extern _X_EXPORT void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save); #endif int port_rep_inb(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count); + uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_inw(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count); + uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_inl(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count); + uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_outb(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count); + uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_outw(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count); + uint16_t port, uint32_t base, int d_f, uint32_t count); int port_rep_outl(xf86Int10InfoPtr pInt, - CARD16 port, CARD32 base, int d_f, CARD32 count); - -CARD8 x_inb(CARD16 port); -CARD16 x_inw(CARD16 port); -void x_outb(CARD16 port, CARD8 val); -void x_outw(CARD16 port, CARD16 val); -CARD32 x_inl(CARD16 port); -void x_outl(CARD16 port, CARD32 val); - -CARD8 Mem_rb(CARD32 addr); -CARD16 Mem_rw(CARD32 addr); -CARD32 Mem_rl(CARD32 addr); -void Mem_wb(CARD32 addr, CARD8 val); -void Mem_ww(CARD32 addr, CARD16 val); -void Mem_wl(CARD32 addr, CARD32 val); + uint16_t port, uint32_t base, int d_f, uint32_t count); + +uint8_t x_inb(uint16_t port); +uint16_t x_inw(uint16_t port); +void x_outb(uint16_t port, uint8_t val); +void x_outw(uint16_t port, uint16_t val); +uint32_t x_inl(uint16_t port); +void x_outl(uint16_t port, uint32_t val); + +uint8_t Mem_rb(uint32_t addr); +uint16_t Mem_rw(uint32_t addr); +uint32_t Mem_rl(uint32_t addr); +void Mem_wb(uint32_t addr, uint8_t val); +void Mem_ww(uint32_t addr, uint16_t val); +void Mem_wl(uint32_t addr, uint32_t val); /* helper_mem.c */ void setup_int_vect(xf86Int10InfoPtr pInt); diff --git a/xorg-server/hw/xfree86/int10/xf86x86emu.c b/xorg-server/hw/xfree86/int10/xf86x86emu.c index 0f8737b49..b9a4d3603 100644 --- a/xorg-server/hw/xfree86/int10/xf86x86emu.c +++ b/xorg-server/hw/xfree86/int10/xf86x86emu.c @@ -50,12 +50,12 @@ xf86Int10ExecSetup(xf86Int10InfoPtr pInt) X86EMU_intrFuncs intFuncs[256]; X86EMU_pioFuncs pioFuncs = { - (&x_inb), - (&x_inw), - (&x_inl), - (&x_outb), - (&x_outw), - (&x_outl) + .inb = x_inb, + .inw = x_inw, + .inl = x_inl, + .outb = x_outb, + .outw = x_outw, + .outl = x_outl }; X86EMU_memFuncs memFuncs = { diff --git a/xorg-server/hw/xfree86/loader/loaderProcs.h b/xorg-server/hw/xfree86/loader/loaderProcs.h index 8b4b53f28..cfc4d8069 100644 --- a/xorg-server/hw/xfree86/loader/loaderProcs.h +++ b/xorg-server/hw/xfree86/loader/loaderProcs.h @@ -72,10 +72,10 @@ typedef struct module_desc { void LoaderInit(void); -ModuleDescPtr LoadDriver(const char *, const char *, int, pointer, int *, +ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *, int *); ModuleDescPtr LoadModule(const char *, const char *, const char **, - const char **, pointer, const XF86ModReqInfo *, + const char **, void *, const XF86ModReqInfo *, int *, int *); ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent); void UnloadDriver(ModuleDescPtr); diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c index 2347b8e5b..092bf5735 100644 --- a/xorg-server/hw/xfree86/loader/loadmod.c +++ b/xorg-server/hw/xfree86/loader/loadmod.c @@ -81,7 +81,7 @@ static void UnloadModuleOrDriver(ModuleDescPtr mod); static char *LoaderGetCanonicalName(const char *, PatternPtr); static void RemoveChild(ModuleDescPtr); static ModuleDescPtr doLoadModule(const char *, const char *, const char **, - const char **, pointer, + const char **, void *, const XF86ModReqInfo *, int *, int *); const ModuleVersions LoaderVersionInfo = { @@ -482,7 +482,7 @@ FindModule(const char *module, const char *dirname, const char **subdirlist, return name; } -char ** +const char ** LoaderListDirs(const char **subdirlist, const char **patternlist) { char buf[PATH_MAX + 1]; @@ -490,7 +490,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) char **elem; const char **subdirs; const char **s; - PatternPtr patterns; + PatternPtr patterns = NULL; PatternPtr p; DIR *d; struct dirent *dp; @@ -571,7 +571,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) FreePatterns(patterns); FreeSubdirs(subdirs); FreePathList(pathlist); - return ret; + return (const char **) ret; } void @@ -761,10 +761,10 @@ AddSibling(ModuleDescPtr head, ModuleDescPtr new) return new; } -pointer -LoadSubModule(pointer _parent, const char *module, +void * +LoadSubModule(void *_parent, const char *module, const char **subdirlist, const char **patternlist, - pointer options, const XF86ModReqInfo * modreq, + void *options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { ModuleDescPtr submod; @@ -843,7 +843,7 @@ static const char *compiled_in_modules[] = { static ModuleDescPtr doLoadModule(const char *module, const char *path, const char **subdirlist, - const char **patternlist, pointer options, + const char **patternlist, void *options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { XF86ModuleData *initdata = NULL; @@ -1071,7 +1071,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, */ ModuleDescPtr LoadModule(const char *module, const char *path, const char **subdirlist, - const char **patternlist, pointer options, + const char **patternlist, void *options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { return doLoadModule(module, path, subdirlist, patternlist, options, @@ -1079,7 +1079,7 @@ LoadModule(const char *module, const char *path, const char **subdirlist, } void -UnloadModule(pointer mod) +UnloadModule(void *mod) { UnloadModuleOrDriver((ModuleDescPtr) mod); } @@ -1115,7 +1115,7 @@ UnloadModuleOrDriver(ModuleDescPtr mod) } void -UnloadSubModule(pointer _mod) +UnloadSubModule(void *_mod) { ModuleDescPtr mod = (ModuleDescPtr) _mod; diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index a441fd16a..b2eb72e8e 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -379,7 +379,7 @@ xf86CrtcSetModeTransform(xf86CrtcPtr crtc, DisplayModePtr mode, crtc->transformPresent = saved_transform_present; } - free(adjusted_mode->name); + free((void *) adjusted_mode->name); free(adjusted_mode); if (didLock) @@ -564,8 +564,8 @@ static const char *direction[4] = { static Rotation xf86OutputInitialRotation(xf86OutputPtr output) { - char *rotate_name = xf86GetOptValString(output->options, - OPTION_ROTATE); + const char *rotate_name = xf86GetOptValString(output->options, + OPTION_ROTATE); int i; if (!rotate_name) { @@ -926,7 +926,6 @@ xf86PickCrtcs(ScrnInfoPtr scrn, xf86OutputPtr output; xf86CrtcPtr crtc; xf86CrtcPtr *crtcs; - xf86CrtcPtr best_crtc; int best_score; int score; int my_score; @@ -939,7 +938,6 @@ xf86PickCrtcs(ScrnInfoPtr scrn, * Compute score with this output disabled */ best_crtcs[n] = NULL; - best_crtc = NULL; best_score = xf86PickCrtcs(scrn, best_crtcs, modes, n + 1, width, height); if (modes[n] == NULL) return best_score; @@ -993,7 +991,6 @@ xf86PickCrtcs(ScrnInfoPtr scrn, score = my_score + xf86PickCrtcs(scrn, crtcs, modes, n + 1, width, height); if (score > best_score) { - best_crtc = crtc; best_score = score; memcpy(best_crtcs, crtcs, config->num_output * sizeof(xf86CrtcPtr)); } @@ -1087,8 +1084,8 @@ xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr * modes) for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; - char *position; - char *relative_name; + const char *position; + const char *relative_name; OutputOpts relation; int r; @@ -1145,8 +1142,8 @@ xf86InitialOutputPositions(ScrnInfoPtr scrn, DisplayModePtr * modes) }; xf86OutputPtr output = config->output[o]; xf86OutputPtr relative; - char *relative_name; - char *position; + const char *relative_name; + const char *position; OutputOpts relation; int r; @@ -1306,7 +1303,7 @@ xf86InitialPanning(ScrnInfoPtr scrn) for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; - char *panning = xf86GetOptValString(output->options, OPTION_PANNING); + const char *panning = xf86GetOptValString(output->options, OPTION_PANNING); int width, height, left, top; int track_width, track_height, track_left, track_top; int brdr[4]; @@ -1389,7 +1386,7 @@ xf86SortModes(DisplayModePtr input) for (o = output; o && (n = o->next); o = n) { if (!strcmp(o->name, n->name) && xf86ModesEqual(o, n)) { o->next = n->next; - free(n->name); + free((void *) n->name); free(n); n = o; } @@ -1403,10 +1400,10 @@ xf86SortModes(DisplayModePtr input) return output; } -static char * +static const char * preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output) { - char *preferred_mode = NULL; + const char *preferred_mode = NULL; /* Check for a configured preference for a particular mode */ preferred_mode = xf86GetOptValString(output->options, @@ -1610,7 +1607,7 @@ xf86ProbeOutputModes(ScrnInfoPtr scrn, int maxX, int maxY) xf86OutputPtr output = config->output[o]; DisplayModePtr mode; DisplayModePtr config_modes = NULL, output_modes, default_modes = NULL; - char *preferred_mode; + const char *preferred_mode; xf86MonPtr edid_monitor; XF86ConfMonitorPtr conf_monitor; MonRec mon_rec; @@ -1833,10 +1830,6 @@ xf86ProbeOutputModes(ScrnInfoPtr scrn, int maxX, int maxY) * Copy one of the output mode lists to the ScrnInfo record */ -/* XXX where does this function belong? Here? */ -void - xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y); - static DisplayModePtr biggestMode(DisplayModePtr a, DisplayModePtr b) { diff --git a/xorg-server/hw/xfree86/modes/xf86Modes.c b/xorg-server/hw/xfree86/modes/xf86Modes.c index c4a3eb0a3..43b223307 100644 --- a/xorg-server/hw/xfree86/modes/xf86Modes.c +++ b/xorg-server/hw/xfree86/modes/xf86Modes.c @@ -129,11 +129,13 @@ void xf86SetModeDefaultName(DisplayModePtr mode) { Bool interlaced = ! !(mode->Flags & V_INTERLACE); + char *tmp; - free(mode->name); + free((void *) mode->name); - XNFasprintf(&mode->name, "%dx%d%s", mode->HDisplay, mode->VDisplay, + XNFasprintf(&tmp, "%dx%d%s", mode->HDisplay, mode->VDisplay, interlaced ? "i" : ""); + mode->name = tmp; } /* diff --git a/xorg-server/hw/xfree86/modes/xf86RandR12.c b/xorg-server/hw/xfree86/modes/xf86RandR12.c index 76614de78..f7a7d44d9 100644 --- a/xorg-server/hw/xfree86/modes/xf86RandR12.c +++ b/xorg-server/hw/xfree86/modes/xf86RandR12.c @@ -454,7 +454,6 @@ xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; - int refresh0 = 60; int maxX = 0, maxY = 0; *rotations = randrp->supported_rotations; @@ -479,8 +478,6 @@ xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) if (maxY < mode->VDisplay) maxY = mode->VDisplay; } - if (mode == scrp->modes) - refresh0 = refresh; pSize = RRRegisterSize(pScreen, mode->HDisplay, mode->VDisplay, randrp->mmWidth, randrp->mmHeight); @@ -684,7 +681,6 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, WindowPtr pRoot = pScreen->root; PixmapPtr pScrnPix; Bool ret = FALSE; - Bool panning = FALSE; int c; if (xf86RandR12Key) { @@ -716,7 +712,6 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, crtc->panningTrackingArea.y2 += height - pScreen->height; xf86RandR13VerifyPanningArea(crtc, width, height); xf86RandR13Pan(crtc, randrp->pointerX, randrp->pointerY); - panning = TRUE; } } @@ -946,8 +941,6 @@ xf86RandR12SetRotations(ScreenPtr pScreen, Rotation rotations) void xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) { - XF86RandRInfoPtr randrp; - #if RANDR_13_INTERFACE ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int c; @@ -957,7 +950,6 @@ xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) if (xf86RandR12Key == NULL) return; - randrp = XF86RANDRINFO(pScreen); #if RANDR_13_INTERFACE for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; @@ -1455,7 +1447,6 @@ xf86RandR12SetInfo12(ScreenPtr pScreen) RRCrtcPtr *crtcs; int ncrtc; int o, c, l; - RRCrtcPtr randr_crtc; int nclone; clones = malloc(config->num_output * sizeof(RROutputPtr)); @@ -1468,11 +1459,6 @@ xf86RandR12SetInfo12(ScreenPtr pScreen) if (output->possible_crtcs & (1 << c)) crtcs[ncrtc++] = config->crtc[c]->randr_crtc; - if (output->crtc) - randr_crtc = output->crtc->randr_crtc; - else - randr_crtc = NULL; - if (!RROutputSetCrtcs(output->randr_output, crtcs, ncrtc)) { free(crtcs); free(clones); diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c index 495af9ba7..0ddd8408e 100644 --- a/xorg-server/hw/xfree86/modes/xf86Rotate.c +++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c @@ -229,13 +229,12 @@ xf86RotateRedisplay(ScreenPtr pScreen) static void xf86RotateBlockHandler(ScreenPtr pScreen, - pointer pTimeout, pointer pReadmask) + void *pTimeout, void *pReadmask) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - Bool rotation_active; - rotation_active = xf86RotateRedisplay(pScreen); + xf86RotateRedisplay(pScreen); pScreen->BlockHandler = xf86_config->BlockHandler; (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); /* cannot avoid re-wrapping until all wrapping is audited */ @@ -247,7 +246,6 @@ void xf86RotateDestroy(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; - ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int c; @@ -267,9 +265,6 @@ xf86RotateDestroy(xf86CrtcPtr crtc) * Clean up damage structures when no crtcs are rotated */ if (xf86_config->rotation_damage) { - DrawablePtr screenDrawable = NULL; - if (pScreen && pScreen->root) - screenDrawable = &pScreen->root->drawable; /* Free damage structure */ if (xf86_config->rotation_damage_registered) { xf86_config->rotation_damage_registered = FALSE; diff --git a/xorg-server/hw/xfree86/modes/xf86cvt.c b/xorg-server/hw/xfree86/modes/xf86cvt.c index de0784493..8b7bb8b03 100644 --- a/xorg-server/hw/xfree86/modes/xf86cvt.c +++ b/xorg-server/hw/xfree86/modes/xf86cvt.c @@ -89,6 +89,7 @@ xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, int HDisplayRnd, HMargin; int VDisplayRnd, VMargin, VSync; float Interlace; /* Please rename this */ + char *tmp; /* CVT default is 60.0Hz */ if (!VRefresh) @@ -177,6 +178,7 @@ xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, /* 10. Find number of lines in back porch */ VBackPorch = VSyncAndBackPorch - VSync; + (void) VBackPorch; /* 11. Find total number of lines in vertical field */ Mode->VTotal = VDisplayRnd + 2 * VMargin + VSyncAndBackPorch + Interlace @@ -282,7 +284,8 @@ xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, if (Interlaced) Mode->VTotal *= 2; - XNFasprintf(&Mode->name, "%dx%d", HDisplay, VDisplay); + XNFasprintf(&tmp, "%dx%d", HDisplay, VDisplay); + Mode->name = tmp; if (Reduced) Mode->Flags |= V_PHSYNC | V_NVSYNC; diff --git a/xorg-server/hw/xfree86/modes/xf86gtf.c b/xorg-server/hw/xfree86/modes/xf86gtf.c index 23707b481..0a8078415 100644 --- a/xorg-server/hw/xfree86/modes/xf86gtf.c +++ b/xorg-server/hw/xfree86/modes/xf86gtf.c @@ -215,6 +215,7 @@ xf86GTFMode(int h_pixels, int v_lines, float freq, int interlaced, int margins) */ v_back_porch = vsync_plus_bp - V_SYNC_RQD; + (void) v_back_porch; /* 10. Find the total number of lines in Vertical field period: * @@ -253,6 +254,7 @@ xf86GTFMode(int h_pixels, int v_lines, float freq, int interlaced, int margins) */ v_frame_rate = interlaced ? v_field_rate / 2.0 : v_field_rate; + (void) v_frame_rate; /* 15. Find number of pixels in left margin: * diff --git a/xorg-server/hw/xfree86/os-support/bsd/alpha_video.c b/xorg-server/hw/xfree86/os-support/bsd/alpha_video.c index 91f9fc826..95bd0591a 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/alpha_video.c +++ b/xorg-server/hw/xfree86/os-support/bsd/alpha_video.c @@ -189,10 +189,10 @@ static int devMemFd = -1; #define DEV_APERTURE "/dev/xf86" #endif -static pointer mapVidMem(int, unsigned long, unsigned long, int); -static void unmapVidMem(int, pointer, unsigned long); -static pointer mapVidMemSparse(int, unsigned long, unsigned long, int); -static void unmapVidMemSparse(int, pointer, unsigned long); +static void *mapVidMem(int, unsigned long, unsigned long, int); +static void unmapVidMem(int, void *, unsigned long); +static void *mapVidMemSparse(int, unsigned long, unsigned long, int); +static void unmapVidMemSparse(int, void *, unsigned long); /* * Check if /dev/mem can be mmap'd. If it can't print a warning when @@ -203,7 +203,7 @@ checkDevMem(Bool warn) { static Bool devMemChecked = FALSE; int fd; - pointer base; + void *base; if (devMemChecked) return; @@ -295,10 +295,10 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->initialised = TRUE; } -static pointer +static void * mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { - pointer base; + void *base; checkDevMem(FALSE); Base = Base & ((1L << 32) - 1); @@ -336,7 +336,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) } static void -unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +unmapVidMem(int ScreenNum, void *Base, unsigned long Size) { munmap((caddr_t) Base, Size); } @@ -424,40 +424,40 @@ xf86DisableIO() #define vuip volatile unsigned int * -static pointer memSBase = 0; -static pointer memBase = 0; +static void *memSBase = 0; +static void *memBase = 0; -extern int readDense8(pointer Base, register unsigned long Offset); -extern int readDense16(pointer Base, register unsigned long Offset); -extern int readDense32(pointer Base, register unsigned long Offset); +extern int readDense8(void *Base, register unsigned long Offset); +extern int readDense16(void *Base, register unsigned long Offset); +extern int readDense32(void *Base, register unsigned long Offset); extern void - writeDenseNB8(int Value, pointer Base, register unsigned long Offset); + writeDenseNB8(int Value, void *Base, register unsigned long Offset); extern void - writeDenseNB16(int Value, pointer Base, register unsigned long Offset); + writeDenseNB16(int Value, void *Base, register unsigned long Offset); extern void - writeDenseNB32(int Value, pointer Base, register unsigned long Offset); + writeDenseNB32(int Value, void *Base, register unsigned long Offset); extern void - writeDense8(int Value, pointer Base, register unsigned long Offset); + writeDense8(int Value, void *Base, register unsigned long Offset); extern void - writeDense16(int Value, pointer Base, register unsigned long Offset); + writeDense16(int Value, void *Base, register unsigned long Offset); extern void - writeDense32(int Value, pointer Base, register unsigned long Offset); + writeDense32(int Value, void *Base, register unsigned long Offset); -static int readSparse8(pointer Base, register unsigned long Offset); -static int readSparse16(pointer Base, register unsigned long Offset); -static int readSparse32(pointer Base, register unsigned long Offset); +static int readSparse8(void *Base, register unsigned long Offset); +static int readSparse16(void *Base, register unsigned long Offset); +static int readSparse32(void *Base, register unsigned long Offset); static void - writeSparseNB8(int Value, pointer Base, register unsigned long Offset); + writeSparseNB8(int Value, void *Base, register unsigned long Offset); static void - writeSparseNB16(int Value, pointer Base, register unsigned long Offset); + writeSparseNB16(int Value, void *Base, register unsigned long Offset); static void - writeSparseNB32(int Value, pointer Base, register unsigned long Offset); + writeSparseNB32(int Value, void *Base, register unsigned long Offset); static void - writeSparse8(int Value, pointer Base, register unsigned long Offset); + writeSparse8(int Value, void *Base, register unsigned long Offset); static void - writeSparse16(int Value, pointer Base, register unsigned long Offset); + writeSparse16(int Value, void *Base, register unsigned long Offset); static void - writeSparse32(int Value, pointer Base, register unsigned long Offset); + writeSparse32(int Value, void *Base, register unsigned long Offset); #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) extern int sysarch(int, void *); @@ -481,7 +481,7 @@ sethae(u_int64_t hae) } #endif -static pointer +static void * mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { @@ -514,16 +514,16 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, strerror(errno)); } } - return (pointer) ((unsigned long) memBase + Base); + return (void *) ((unsigned long) memBase + Base); } static void -unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size) +unmapVidMemSparse(int ScreenNum, void *Base, unsigned long Size) { } static int -readSparse8(pointer Base, register unsigned long Offset) +readSparse8(void *Base, register unsigned long Offset) { register unsigned long result, shift; register unsigned long msb; @@ -544,7 +544,7 @@ readSparse8(pointer Base, register unsigned long Offset) } static int -readSparse16(pointer Base, register unsigned long Offset) +readSparse16(void *Base, register unsigned long Offset) { register unsigned long result, shift; register unsigned long msb; @@ -566,14 +566,14 @@ readSparse16(pointer Base, register unsigned long Offset) } static int -readSparse32(pointer Base, register unsigned long Offset) +readSparse32(void *Base, register unsigned long Offset) { mem_barrier(); return *(vuip) ((unsigned long) Base + (Offset)); } static void -writeSparse8(int Value, pointer Base, register unsigned long Offset) +writeSparse8(int Value, void *Base, register unsigned long Offset) { register unsigned long msb; register unsigned int b = Value & 0xffU; @@ -591,7 +591,7 @@ writeSparse8(int Value, pointer Base, register unsigned long Offset) } static void -writeSparse16(int Value, pointer Base, register unsigned long Offset) +writeSparse16(int Value, void *Base, register unsigned long Offset) { register unsigned long msb; register unsigned int w = Value & 0xffffU; @@ -611,7 +611,7 @@ writeSparse16(int Value, pointer Base, register unsigned long Offset) } static void -writeSparse32(int Value, pointer Base, register unsigned long Offset) +writeSparse32(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(vuip) ((unsigned long) Base + (Offset)) = Value; @@ -619,7 +619,7 @@ writeSparse32(int Value, pointer Base, register unsigned long Offset) } static void -writeSparseNB8(int Value, pointer Base, register unsigned long Offset) +writeSparseNB8(int Value, void *Base, register unsigned long Offset) { register unsigned long msb; register unsigned int b = Value & 0xffU; @@ -636,7 +636,7 @@ writeSparseNB8(int Value, pointer Base, register unsigned long Offset) } static void -writeSparseNB16(int Value, pointer Base, register unsigned long Offset) +writeSparseNB16(int Value, void *Base, register unsigned long Offset) { register unsigned long msb; register unsigned int w = Value & 0xffffU; @@ -654,27 +654,27 @@ writeSparseNB16(int Value, pointer Base, register unsigned long Offset) } static void -writeSparseNB32(int Value, pointer Base, register unsigned long Offset) +writeSparseNB32(int Value, void *Base, register unsigned long Offset) { *(vuip) ((unsigned long) Base + (Offset)) = Value; return; } -void (*xf86WriteMmio8) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmio8) (int Value, void *Base, unsigned long Offset) = writeDense8; -void (*xf86WriteMmio16) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmio16) (int Value, void *Base, unsigned long Offset) = writeDense16; -void (*xf86WriteMmio32) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmio32) (int Value, void *Base, unsigned long Offset) = writeDense32; -void (*xf86WriteMmioNB8) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmioNB8) (int Value, void *Base, unsigned long Offset) = writeDenseNB8; -void (*xf86WriteMmioNB16) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmioNB16) (int Value, void *Base, unsigned long Offset) = writeDenseNB16; -void (*xf86WriteMmioNB32) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmioNB32) (int Value, void *Base, unsigned long Offset) = writeDenseNB32; -int (*xf86ReadMmio8) (pointer Base, unsigned long Offset) +int (*xf86ReadMmio8) (void *Base, unsigned long Offset) = readDense8; -int (*xf86ReadMmio16) (pointer Base, unsigned long Offset) +int (*xf86ReadMmio16) (void *Base, unsigned long Offset) = readDense16; -int (*xf86ReadMmio32) (pointer Base, unsigned long Offset) +int (*xf86ReadMmio32) (void *Base, unsigned long Offset) = readDense32; diff --git a/xorg-server/hw/xfree86/os-support/bsd/arm_video.c b/xorg-server/hw/xfree86/os-support/bsd/arm_video.c index 71064af03..6a977c2db 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/arm_video.c +++ b/xorg-server/hw/xfree86/os-support/bsd/arm_video.c @@ -71,12 +71,12 @@ struct memAccess { int ioctl; struct map_info memInfo; - pointer regionVirtBase; + void *regionVirtBase; Bool Checked; Bool OK; }; -static pointer xf86MapInfoMap(); +static void *xf86MapInfoMap(); static void xf86MapInfoUnmap(); static struct memAccess *checkMapInfo(); extern int vgaPhysLinearBase; @@ -111,8 +111,8 @@ struct memAccess ioMemInfo = { CONSOLE_GET_IO_INFO, NULL, NULL, static Bool useDevMem = FALSE; static int devMemFd = -1; -static pointer mapVidMem(int, unsigned long, unsigned long, int); -static void unmapVidMem(int, pointer, unsigned long); +static void *mapVidMem(int, unsigned long, unsigned long, int); +static void unmapVidMem(int, void *, unsigned long); /* * Check if /dev/mem can be mmap'd. If it can't print a warning when @@ -123,7 +123,7 @@ checkDevMem(Bool warn) { static Bool devMemChecked = FALSE; int fd; - pointer base; + void *base; if (devMemChecked) return; @@ -170,10 +170,10 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->initialised = TRUE; } -static pointer +static void * mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { - pointer base; + void *base; checkDevMem(FALSE); @@ -210,7 +210,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) } static void -unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +unmapVidMem(int ScreenNum, void *Base, unsigned long Size) { munmap((caddr_t) Base, Size); } @@ -310,8 +310,8 @@ checkMapInfo(Bool warn, int Region) } } -static pointer -xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size) +static void * +xf86MapInfoMap(struct memAccess *memInfoP, void *Base, unsigned long Size) { struct map_info *mapInfoP = &(memInfoP->memInfo); @@ -335,7 +335,7 @@ xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size) MAP_SHARED, xf86Info.consoleFd, (unsigned long) mapInfoP->u.map_info_mmap.map_offset)) - == (pointer) -1) { + == (void *) -1) { FatalError ("xf86MapInfoMap: Failed to map memory at 0x%x\n\t%s\n", mapInfoP->u.map_info_mmap.map_offset, strerror(errno)); @@ -351,7 +351,7 @@ xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size) break; } - return (pointer) ((int) memInfoP->regionVirtBase + (int) Base); + return (void *) ((int) memInfoP->regionVirtBase + (int) Base); } static void @@ -374,7 +374,7 @@ xf86MapInfoUnmap(struct memAccess *memInfoP, unsigned long Size) } } -static pointer +static void * armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { struct memAccess *memInfoP; @@ -404,7 +404,7 @@ armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) } static void -armUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +armUnmapVidMem(int ScreenNum, void *Base, unsigned long Size) { struct memAccess *memInfoP; @@ -450,17 +450,17 @@ Bool xf86EnableIO() { int fd; - pointer base; + void *base; if (ExtendedEnabled) return TRUE; if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) { /* Try to map a page at the pccons I/O space */ - base = (pointer) mmap((caddr_t) 0, 65536, PROT_READ | PROT_WRITE, - MAP_FLAGS, fd, (off_t) 0x0000); + base = (void *) mmap((caddr_t) 0, 65536, PROT_READ | PROT_WRITE, + MAP_FLAGS, fd, (off_t) 0x0000); - if (base != (pointer) -1) { + if (base != (void *) -1) { IOPortBase = base; } else { @@ -509,7 +509,7 @@ int ScreenNum; { int i; int fd; - pointer base; + void *base; #ifdef __arm32__ struct memAccess *memInfoP; @@ -524,10 +524,10 @@ int ScreenNum; #ifdef USE_ARC_MMAP if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) { /* Try to map a page at the pccons I/O space */ - base = (pointer) mmap((caddr_t) 0, 65536, PROT_READ | PROT_WRITE, - MAP_FLAGS, fd, (off_t) 0x0000); + base = (void *) mmap((caddr_t) 0, 65536, PROT_READ | PROT_WRITE, + MAP_FLAGS, fd, (off_t) 0x0000); - if (base != (pointer) -1) { + if (base != (void *) -1) { IOPortBase = base; } else { @@ -563,10 +563,10 @@ int ScreenNum; checkDevMem(TRUE); if (devMemFd >= 0 && useDevMem) { - base = (pointer) mmap((caddr_t) 0, 0x400, PROT_READ | PROT_WRITE, + base = (void *) mmap((caddr_t) 0, 0x400, PROT_READ | PROT_WRITE, MAP_FLAGS, devMemFd, (off_t) DEV_MEM_IOBASE); - if (base != (pointer) -1) + if (base != (void *) -1) IOPortBase = (unsigned int) base; } diff --git a/xorg-server/hw/xfree86/os-support/bsd/bsd_apm.c b/xorg-server/hw/xfree86/os-support/bsd/bsd_apm.c index b1938cf0d..1b929625e 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/bsd_apm.c +++ b/xorg-server/hw/xfree86/os-support/bsd/bsd_apm.c @@ -14,7 +14,7 @@ #define APM_DEVICE "/dev/apm" -static pointer APMihPtr = NULL; +static void *APMihPtr = NULL; static void bsdCloseAPM(void); static struct { diff --git a/xorg-server/hw/xfree86/os-support/bsd/bsd_ev56.c b/xorg-server/hw/xfree86/os-support/bsd/bsd_ev56.c index 645377ed6..320bb23b6 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/bsd_ev56.c +++ b/xorg-server/hw/xfree86/os-support/bsd/bsd_ev56.c @@ -22,77 +22,77 @@ */ __asm(".arch ev56"); -int readDense8(pointer Base, register unsigned long Offset); -int readDense16(pointer Base, register unsigned long Offset); -int readDense32(pointer Base, register unsigned long Offset); +int readDense8(void *Base, register unsigned long Offset); +int readDense16(void *Base, register unsigned long Offset); +int readDense32(void *Base, register unsigned long Offset); void - writeDenseNB8(int Value, pointer Base, register unsigned long Offset); + writeDenseNB8(int Value, void *Base, register unsigned long Offset); void - writeDenseNB16(int Value, pointer Base, register unsigned long Offset); + writeDenseNB16(int Value, void *Base, register unsigned long Offset); void - writeDenseNB32(int Value, pointer Base, register unsigned long Offset); + writeDenseNB32(int Value, void *Base, register unsigned long Offset); void - writeDense8(int Value, pointer Base, register unsigned long Offset); + writeDense8(int Value, void *Base, register unsigned long Offset); void - writeDense16(int Value, pointer Base, register unsigned long Offset); + writeDense16(int Value, void *Base, register unsigned long Offset); void - writeDense32(int Value, pointer Base, register unsigned long Offset); + writeDense32(int Value, void *Base, register unsigned long Offset); int -readDense8(pointer Base, register unsigned long Offset) +readDense8(void *Base, register unsigned long Offset) { mem_barrier(); - return (alpha_ldbu((pointer) ((unsigned long) Base + (Offset)))); + return (alpha_ldbu((void *) ((unsigned long) Base + (Offset)))); } int -readDense16(pointer Base, register unsigned long Offset) +readDense16(void *Base, register unsigned long Offset) { mem_barrier(); - return (alpha_ldwu((pointer) ((unsigned long) Base + (Offset)))); + return (alpha_ldwu((void *) ((unsigned long) Base + (Offset)))); } int -readDense32(pointer Base, register unsigned long Offset) +readDense32(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); } void -writeDenseNB8(int Value, pointer Base, register unsigned long Offset) +writeDenseNB8(int Value, void *Base, register unsigned long Offset) { - alpha_stb((pointer) ((unsigned long) Base + (Offset)), Value); + alpha_stb((void *) ((unsigned long) Base + (Offset)), Value); } void -writeDenseNB16(int Value, pointer Base, register unsigned long Offset) +writeDenseNB16(int Value, void *Base, register unsigned long Offset) { - alpha_stw((pointer) ((unsigned long) Base + (Offset)), Value); + alpha_stw((void *) ((unsigned long) Base + (Offset)), Value); } void -writeDenseNB32(int Value, pointer Base, register unsigned long Offset) +writeDenseNB32(int Value, void *Base, register unsigned long Offset) { *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; } void -writeDense8(int Value, pointer Base, register unsigned long Offset) +writeDense8(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); - alpha_stb((pointer) ((unsigned long) Base + (Offset)), Value); + alpha_stb((void *) ((unsigned long) Base + (Offset)), Value); } void -writeDense16(int Value, pointer Base, register unsigned long Offset) +writeDense16(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); - alpha_stw((pointer) ((unsigned long) Base + (Offset)), Value); + alpha_stw((void *) ((unsigned long) Base + (Offset)), Value); } void -writeDense32(int Value, pointer Base, register unsigned long Offset) +writeDense32(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; diff --git a/xorg-server/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/xorg-server/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c index 22943855b..32ea4892e 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c +++ b/xorg-server/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c @@ -45,7 +45,7 @@ #define _PATH_APM_DEV "/dev/apm" #define _PATH_APM_CTLDEV "/dev/apmctl" -static pointer APMihPtr = NULL; +static void *APMihPtr = NULL; static int devFd = -1; static int ctlFd = -1; static void bsdCloseAPM(void); diff --git a/xorg-server/hw/xfree86/os-support/bsd/i386_video.c b/xorg-server/hw/xfree86/os-support/bsd/i386_video.c index 569a4ec51..745319054 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/i386_video.c +++ b/xorg-server/hw/xfree86/os-support/bsd/i386_video.c @@ -85,18 +85,18 @@ static int devMemFd = -1; #define DEV_APERTURE "/dev/xf86" #endif -static pointer mapVidMem(int, unsigned long, unsigned long, int); -static void unmapVidMem(int, pointer, unsigned long); +static void *mapVidMem(int, unsigned long, unsigned long, int); +static void unmapVidMem(int, void *, unsigned long); #ifdef HAS_MTRR_SUPPORT -static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType); -static void undoWC(int, pointer); +static void *setWC(int, unsigned long, unsigned long, Bool, MessageType); +static void undoWC(int, void *); static Bool cleanMTRR(void); #endif #if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__) -static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool, +static void *NetBSDsetWC(int, unsigned long, unsigned long, Bool, MessageType); -static void NetBSDundoWC(int, pointer); +static void NetBSDundoWC(int, void *); #endif /* @@ -108,7 +108,7 @@ checkDevMem(Bool warn) { static Bool devMemChecked = FALSE; int fd; - pointer base; + void *base; if (devMemChecked) return; @@ -210,10 +210,10 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->initialised = TRUE; } -static pointer +static void * mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { - pointer base; + void *base; checkDevMem(FALSE); @@ -250,7 +250,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) } static void -unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +unmapVidMem(int ScreenNum, void *Base, unsigned long Size) { munmap((caddr_t) Base, Size); } @@ -690,7 +690,7 @@ fullCoverage(unsigned long base, unsigned long size, RangePtr overlap) return FALSE; } -static pointer +static void * addWC(int screenNum, unsigned long base, unsigned long size, MessageType from) { RangePtr uc = NULL, wc = NULL, retlist = NULL; @@ -731,7 +731,7 @@ addWC(int screenNum, unsigned long base, unsigned long size, MessageType from) } } -static pointer +static void * delWC(int screenNum, unsigned long base, unsigned long size, MessageType from) { RangePtr uc = NULL, wc = NULL, retlist = NULL; @@ -776,7 +776,7 @@ delWC(int screenNum, unsigned long base, unsigned long size, MessageType from) } } -static pointer +static void * setWC(int screenNum, unsigned long base, unsigned long size, Bool enable, MessageType from) { @@ -787,7 +787,7 @@ setWC(int screenNum, unsigned long base, unsigned long size, Bool enable, } static void -undoWC(int screenNum, pointer list) +undoWC(int screenNum, void *list) { RangePtr rp; struct mem_range_op mro; @@ -835,7 +835,7 @@ undoWC(int screenNum, pointer list) #endif /* HAS_MTRR_SUPPORT */ #if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__) -static pointer +static void * NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable, MessageType from) { @@ -871,7 +871,7 @@ NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable, } static void -NetBSDundoWC(int screenNum, pointer list) +NetBSDundoWC(int screenNum, void *list) { struct mtrr *mtrrp = (struct mtrr *) list; int n; diff --git a/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c b/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c index 417adbf4b..947a68678 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c +++ b/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c @@ -44,8 +44,8 @@ #define DEV_MEM "/dev/xf86" #endif -static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags); -static void ppcUnmapVidMem(int, pointer, unsigned long); +static void *ppcMapVidMem(int, unsigned long, unsigned long, int flags); +static void ppcUnmapVidMem(int, void *, unsigned long); Bool xf86EnableIO(void); void xf86DisableIO(void); @@ -62,11 +62,11 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) volatile unsigned char *ioBase = MAP_FAILED; -static pointer +static void * ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { int fd = xf86Info.consoleFd; - pointer base; + void *base; #ifdef DEBUG xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); @@ -83,7 +83,7 @@ ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) } static void -ppcUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +ppcUnmapVidMem(int ScreenNum, void *Base, unsigned long Size) { munmap(Base, Size); } diff --git a/xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c b/xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c index 21c166105..02951d602 100644 --- a/xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c +++ b/xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c @@ -38,8 +38,8 @@ /* Video Memory Mapping section */ /***************************************************************************/ -static pointer sparc64MapVidMem(int, unsigned long, unsigned long, int); -static void sparc64UnmapVidMem(int, pointer, unsigned long); +static void *sparc64MapVidMem(int, unsigned long, unsigned long, int); +static void sparc64UnmapVidMem(int, void *, unsigned long); void xf86OSInitVidMem(VidMemInfoPtr pVidMem) @@ -50,12 +50,12 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->initialised = TRUE; } -static pointer +static void * sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { int fd = xf86Info.consoleFd; - pointer base; + void *base; #ifdef DEBUG xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); @@ -71,7 +71,7 @@ sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, } static void -sparc64UnmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +sparc64UnmapVidMem(int ScreenNum, void *Base, unsigned long Size) { munmap(Base, Size); } diff --git a/xorg-server/hw/xfree86/os-support/bus/Sbus.c b/xorg-server/hw/xfree86/os-support/bus/Sbus.c index 14e6d4bfd..16ce5b58a 100644 --- a/xorg-server/hw/xfree86/os-support/bus/Sbus.c +++ b/xorg-server/hw/xfree86/os-support/bus/Sbus.c @@ -641,10 +641,10 @@ sparcPromPathname2Node(const char *pathName) return i; } -pointer +void * xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size) { - pointer ret; + void *ret; unsigned long pagemask = getpagesize() - 1; unsigned long off = offset & ~pagemask; unsigned long len = ((offset + size + pagemask) & ~pagemask) - off; @@ -657,26 +657,26 @@ xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size) else if (psdp->fd < 0) return NULL; - ret = (pointer) mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, + ret = (void *) mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, psdp->fd, off); - if (ret == (pointer) -1) { - ret = (pointer) mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, + if (ret == (void *) -1) { + ret = (void *) mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, psdp->fd, off); } - if (ret == (pointer) -1) + if (ret == (void *) -1) return NULL; return (char *) ret + (offset - off); } void -xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size) +xf86UnmapSbusMem(sbusDevicePtr psdp, void *addr, unsigned long size) { unsigned long mask = getpagesize() - 1; unsigned long base = (unsigned long) addr & ~mask; unsigned long len = (((unsigned long) addr + size + mask) & ~mask) - base; - munmap((pointer) base, len); + munmap((void *) base, len); } /* Tell OS that we are driving the HW cursor ourselves. */ diff --git a/xorg-server/hw/xfree86/os-support/bus/nobus.c b/xorg-server/hw/xfree86/os-support/bus/nobus.c index dc36ecd0a..4872c5be8 100644 --- a/xorg-server/hw/xfree86/os-support/bus/nobus.c +++ b/xorg-server/hw/xfree86/os-support/bus/nobus.c @@ -1,4 +1,7 @@ -static void +void +__noop_to_appease_ar__(void); + +void __noop_to_appease_ar__(void) { return; diff --git a/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c b/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c index b3b94c9f2..dc1a8e670 100644 --- a/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c +++ b/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c @@ -42,7 +42,7 @@ /************************************************************************** * Video Memory Mapping section ***************************************************************************/ -static pointer +static void * mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) { mach_port_t device, mem_dev; @@ -89,11 +89,11 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) ("xf86MapVidMem() can't mach_port_deallocate.(mem_dev) (%s)\n", strerror(errno)); } - return (pointer) addr; + return (void *) addr; } static void -unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +unmapVidMem(int ScreenNum, void *Base, unsigned long Size) { kern_return_t err = vm_deallocate(mach_task_self(), (int) Base, Size); diff --git a/xorg-server/hw/xfree86/os-support/linux/int10/linux.c b/xorg-server/hw/xfree86/os-support/linux/int10/linux.c index 8bca37524..6181eb9c5 100644 --- a/xorg-server/hw/xfree86/os-support/linux/int10/linux.c +++ b/xorg-server/hw/xfree86/os-support/linux/int10/linux.c @@ -18,7 +18,7 @@ #define DEV_MEM "/dev/mem" #endif #define ALLOC_ENTRIES(x) ((V_RAM / x) - 1) -#define SHMERRORPTR (pointer)(-1) +#define SHMERRORPTR (void *)(-1) #include <fcntl.h> #include <errno.h> @@ -153,9 +153,9 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) goto error0; pInt->mem = &linuxMem; pagesize = getpagesize(); - pInt->private = (pointer) xnfcalloc(1, sizeof(linuxInt10Priv)); + pInt->private = (void *) xnfcalloc(1, sizeof(linuxInt10Priv)); ((linuxInt10Priv *) pInt->private)->alloc = - (pointer) xnfcalloc(1, ALLOC_ENTRIES(pagesize)); + (void *) xnfcalloc(1, ALLOC_ENTRIES(pagesize)); if (!xf86IsEntityPrimary(entityIndex)) { DebugF("Mapping high memory area\n"); @@ -233,10 +233,10 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) * 64K bytes at a time. */ if (!videoBiosMapped) { - memset((pointer) V_BIOS, 0, SYS_BIOS - V_BIOS); + memset((void *) V_BIOS, 0, SYS_BIOS - V_BIOS); DebugF("Reading BIOS\n"); for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE) - if (xf86ReadBIOS(cs, 0, (pointer) cs, V_BIOS_SIZE) < V_BIOS_SIZE) + if (xf86ReadBIOS(cs, 0, (void *) cs, V_BIOS_SIZE) < V_BIOS_SIZE) xf86DrvMsg(screen, X_WARNING, "Unable to retrieve all of segment 0x%06lX.\n", (long) cs); @@ -319,7 +319,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) Bool MapCurrentInt10(xf86Int10InfoPtr pInt) { - pointer addr; + void *addr; int fd = -1; if (Int10Current) { @@ -327,7 +327,7 @@ MapCurrentInt10(xf86Int10InfoPtr pInt) if (((linuxInt10Priv *) Int10Current->private)->highMem >= 0) shmdt((char *) HIGH_MEM); else - munmap((pointer) V_BIOS, (SYS_BIOS - V_BIOS)); + munmap((void *) V_BIOS, (SYS_BIOS - V_BIOS)); } addr = shmat(((linuxInt10Priv *) pInt->private)->lowMem, (char *) 1, SHM_RND); @@ -392,7 +392,7 @@ xf86FreeInt10(xf86Int10InfoPtr pInt) if (((linuxInt10Priv *) pInt->private)->highMem >= 0) shmdt((char *) HIGH_MEM); else - munmap((pointer) V_BIOS, (SYS_BIOS - V_BIOS)); + munmap((void *) V_BIOS, (SYS_BIOS - V_BIOS)); Int10Current = NULL; } @@ -486,22 +486,22 @@ write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val) *((CARD32 *) (memType) addr) = val; } -pointer +void * xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr) { if (addr < V_RAM) return ((linuxInt10Priv *) pInt->private)->base + addr; else if (addr < V_BIOS) - return (pointer) (memType) addr; + return (void *) (memType) addr; else if (addr < SYS_BIOS) { if (((linuxInt10Priv *) pInt->private)->base_high) - return (pointer) (((linuxInt10Priv *) pInt->private)->base_high + return (void *) (((linuxInt10Priv *) pInt->private)->base_high - V_BIOS + addr); else - return (pointer) (memType) addr; + return (void *) (memType) addr; } else - return (pointer) (memType) addr; + return (void *) (memType) addr; } #if defined DoSubModules diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c b/xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c index dcaa19ee1..dbd5afe90 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_acpi.c @@ -33,14 +33,14 @@ #define ACPI_VIDEO_HEAD_END (~0u) static void lnxCloseACPI(void); -static pointer ACPIihPtr = NULL; +static void *ACPIihPtr = NULL; PMClose lnxACPIOpen(void); /* in milliseconds */ #define ACPI_REOPEN_DELAY 1000 static CARD32 -lnxACPIReopen(OsTimerPtr timer, CARD32 time, pointer arg) +lnxACPIReopen(OsTimerPtr timer, CARD32 time, void *arg) { if (lnxACPIOpen()) { TimerFree(timer); @@ -74,13 +74,12 @@ lnxACPIGetEventFromOs(int fd, pmEvent * events, int num) /* Check that we have a video event */ if (!strncmp(ev, "video", 5)) { - char *video = NULL; char *GFX = NULL; char *notify = NULL; char *data = NULL; /* doesn't appear to be used in the kernel */ - unsigned long int notify_l, data_l; + unsigned long int notify_l; - video = strtok(ev, " "); + strtok(ev, " "); if (!(GFX = strtok(NULL, " "))) return 0; @@ -97,8 +96,8 @@ lnxACPIGetEventFromOs(int fd, pmEvent * events, int num) if (!(data = strtok(NULL, " "))) return 0; - data_l = strtoul(data, NULL, 16); #if 0 + data_l = strtoul(data, NULL, 16); ErrorF("data: 0x%lx\n", data_l); #endif diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_apm.c b/xorg-server/hw/xfree86/os-support/linux/lnx_apm.c index 387934099..621691997 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_apm.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_apm.c @@ -36,7 +36,7 @@ extern PMClose lnxACPIOpen(void); static PMClose lnxAPMOpen(void); static void lnxCloseAPM(void); -static pointer APMihPtr = NULL; +static void *APMihPtr = NULL; static struct { apm_event_t apmLinux; diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c b/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c index 49950705a..b6950009c 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c @@ -6,77 +6,77 @@ #include "xf86.h" #include "compiler.h" -int readDense8(pointer Base, register unsigned long Offset); -int readDense16(pointer Base, register unsigned long Offset); -int readDense32(pointer Base, register unsigned long Offset); +int readDense8(void *Base, register unsigned long Offset); +int readDense16(void *Base, register unsigned long Offset); +int readDense32(void *Base, register unsigned long Offset); void - writeDenseNB8(int Value, pointer Base, register unsigned long Offset); + writeDenseNB8(int Value, void *Base, register unsigned long Offset); void - writeDenseNB16(int Value, pointer Base, register unsigned long Offset); + writeDenseNB16(int Value, void *Base, register unsigned long Offset); void - writeDenseNB32(int Value, pointer Base, register unsigned long Offset); + writeDenseNB32(int Value, void *Base, register unsigned long Offset); void - writeDense8(int Value, pointer Base, register unsigned long Offset); + writeDense8(int Value, void *Base, register unsigned long Offset); void - writeDense16(int Value, pointer Base, register unsigned long Offset); + writeDense16(int Value, void *Base, register unsigned long Offset); void - writeDense32(int Value, pointer Base, register unsigned long Offset); + writeDense32(int Value, void *Base, register unsigned long Offset); int -readDense8(pointer Base, register unsigned long Offset) +readDense8(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD8 *) ((unsigned long) Base + (Offset)); } int -readDense16(pointer Base, register unsigned long Offset) +readDense16(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD16 *) ((unsigned long) Base + (Offset)); } int -readDense32(pointer Base, register unsigned long Offset) +readDense32(void *Base, register unsigned long Offset) { mem_barrier(); return *(volatile CARD32 *) ((unsigned long) Base + (Offset)); } void -writeDenseNB8(int Value, pointer Base, register unsigned long Offset) +writeDenseNB8(int Value, void *Base, register unsigned long Offset) { *(volatile CARD8 *) ((unsigned long) Base + (Offset)) = Value; } void -writeDenseNB16(int Value, pointer Base, register unsigned long Offset) +writeDenseNB16(int Value, void *Base, register unsigned long Offset) { *(volatile CARD16 *) ((unsigned long) Base + (Offset)) = Value; } void -writeDenseNB32(int Value, pointer Base, register unsigned long Offset) +writeDenseNB32(int Value, void *Base, register unsigned long Offset) { *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; } void -writeDense8(int Value, pointer Base, register unsigned long Offset) +writeDense8(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD8 *) ((unsigned long) Base + (Offset)) = Value; } void -writeDense16(int Value, pointer Base, register unsigned long Offset) +writeDense16(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD16 *) ((unsigned long) Base + (Offset)) = Value; } void -writeDense32(int Value, pointer Base, register unsigned long Offset) +writeDense32(int Value, void *Base, register unsigned long Offset) { write_mem_barrier(); *(volatile CARD32 *) ((unsigned long) Base + (Offset)) = Value; diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_init.c b/xorg-server/hw/xfree86/os-support/linux/lnx_init.c index bcb039f3f..e2e8d0826 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_init.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_init.c @@ -83,8 +83,8 @@ xf86OpenConsole(void) struct vt_mode VT; struct vt_stat vts; MessageType from = X_PROBED; - char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL }; - char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL }; + const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL }; + const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL }; if (serverGeneration == 1) { diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_kmod.c b/xorg-server/hw/xfree86/os-support/linux/lnx_kmod.c index 0a17c2a81..f5917eefb 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_kmod.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_kmod.c @@ -37,7 +37,7 @@ int xf86LoadKernelModule(const char *modName) { char mpPath[MAX_PATH] = ""; - int fd = -1, status, n; + int fd = -1, status; pid_t pid; /* get the path to the modprobe program */ @@ -76,7 +76,7 @@ xf86LoadKernelModule(const char *modName) "Setting of real/effective user Id to 0/0 failed"); } setenv("PATH", "/sbin", 1); - n = execl(mpPath, "modprobe", modName, NULL); + execl(mpPath, "modprobe", modName, NULL); xf86Msg(X_WARNING, "LoadKernelModule %s\n", strerror(errno)); exit(EXIT_FAILURE); /* if we get here the child's exec failed */ break; diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c index 43d0a364a..824003d26 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c @@ -80,17 +80,17 @@ extern int iopl(int __level); /* Video Memory Mapping section */ /***************************************************************************/ -static pointer mapVidMem(int, unsigned long, unsigned long, int); -static void unmapVidMem(int, pointer, unsigned long); +static void *mapVidMem(int, unsigned long, unsigned long, int); +static void unmapVidMem(int, void *, unsigned long); #if defined (__alpha__) extern void sethae(unsigned long hae); extern unsigned long _bus_base __P((void)) __attribute__ ((const)); extern unsigned long _bus_base_sparse __P((void)) __attribute__ ((const)); -static pointer mapVidMemSparse(int, unsigned long, unsigned long, int); +static void *mapVidMemSparse(int, unsigned long, unsigned long, int); extern axpDevice lnxGetAXP(void); -static void unmapVidMemSparse(int, pointer, unsigned long); +static void unmapVidMemSparse(int, void *, unsigned long); static axpDevice axpSystem = -1; static Bool needSparse; static unsigned long hae_thresh; @@ -102,8 +102,8 @@ static unsigned long bus_base; #define SPLIT_WC_REGIONS 1 -static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType); -static void undoWC(int, pointer); +static void *setWC(int, unsigned long, unsigned long, Bool, MessageType); +static void undoWC(int, void *); /* The file desc for /proc/mtrr. Once opened, left opened, and the mtrr driver will clean up when we exit. */ @@ -339,7 +339,7 @@ mtrr_undo_wc_region(int screenNum, struct mtrr_wc_region *wcr) } } -static pointer +static void * setWC(int screenNum, unsigned long base, unsigned long size, Bool enable, MessageType from) { @@ -350,7 +350,7 @@ setWC(int screenNum, unsigned long base, unsigned long size, Bool enable, } static void -undoWC(int screenNum, pointer regioninfo) +undoWC(int screenNum, void *regioninfo) { mtrr_undo_wc_region(screenNum, regioninfo); } @@ -396,16 +396,16 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) /* Basically, you simply cannot do this on Sparc. You have to do something portable * like use /dev/fb* or mmap() on /proc/bus/pci/X/Y nodes. -DaveM */ -static pointer +static void * mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { return NULL; } #else -static pointer +static void * mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { - pointer base; + void *base; int fd; int mapflags = MAP_SHARED; int prot; @@ -460,7 +460,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) #endif /* !(__sparc__) */ static void -unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +unmapVidMem(int ScreenNum, void *Base, unsigned long Size) { uintptr_t alignOff = (uintptr_t) Base - ((uintptr_t) Base & ~(getpagesize() - 1)); @@ -565,44 +565,44 @@ xf86DisableIO(void) #define vuip volatile unsigned int * -extern int readDense8(pointer Base, register unsigned long Offset); -extern int readDense16(pointer Base, register unsigned long Offset); -extern int readDense32(pointer Base, register unsigned long Offset); +extern int readDense8(void *Base, register unsigned long Offset); +extern int readDense16(void *Base, register unsigned long Offset); +extern int readDense32(void *Base, register unsigned long Offset); extern void - writeDenseNB8(int Value, pointer Base, register unsigned long Offset); + writeDenseNB8(int Value, void *Base, register unsigned long Offset); extern void - writeDenseNB16(int Value, pointer Base, register unsigned long Offset); + writeDenseNB16(int Value, void *Base, register unsigned long Offset); extern void - writeDenseNB32(int Value, pointer Base, register unsigned long Offset); + writeDenseNB32(int Value, void *Base, register unsigned long Offset); extern void - writeDense8(int Value, pointer Base, register unsigned long Offset); + writeDense8(int Value, void *Base, register unsigned long Offset); extern void - writeDense16(int Value, pointer Base, register unsigned long Offset); + writeDense16(int Value, void *Base, register unsigned long Offset); extern void - writeDense32(int Value, pointer Base, register unsigned long Offset); + writeDense32(int Value, void *Base, register unsigned long Offset); -static int readSparse8(pointer Base, register unsigned long Offset); -static int readSparse16(pointer Base, register unsigned long Offset); -static int readSparse32(pointer Base, register unsigned long Offset); +static int readSparse8(void *Base, register unsigned long Offset); +static int readSparse16(void *Base, register unsigned long Offset); +static int readSparse32(void *Base, register unsigned long Offset); static void - writeSparseNB8(int Value, pointer Base, register unsigned long Offset); + writeSparseNB8(int Value, void *Base, register unsigned long Offset); static void - writeSparseNB16(int Value, pointer Base, register unsigned long Offset); + writeSparseNB16(int Value, void *Base, register unsigned long Offset); static void - writeSparseNB32(int Value, pointer Base, register unsigned long Offset); + writeSparseNB32(int Value, void *Base, register unsigned long Offset); static void - writeSparse8(int Value, pointer Base, register unsigned long Offset); + writeSparse8(int Value, void *Base, register unsigned long Offset); static void - writeSparse16(int Value, pointer Base, register unsigned long Offset); + writeSparse16(int Value, void *Base, register unsigned long Offset); static void - writeSparse32(int Value, pointer Base, register unsigned long Offset); + writeSparse32(int Value, void *Base, register unsigned long Offset); #define DENSE_BASE 0x2ff00000000UL #define SPARSE_BASE 0x30000000000UL static unsigned long msb_set = 0; -static pointer +static void * mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { @@ -689,11 +689,11 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, " to DENSE only at 0x%lx\n", Base, Size, ret); #endif - return (pointer) ret; + return (void *) ret; } static void -unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size) +unmapVidMemSparse(int ScreenNum, void *Base, unsigned long Size) { unsigned long Offset = (unsigned long) Base - DENSE_BASE; @@ -709,7 +709,7 @@ unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size) } static int -readSparse8(pointer Base, register unsigned long Offset) +readSparse8(void *Base, register unsigned long Offset) { register unsigned long result, shift; register unsigned long msb; @@ -733,7 +733,7 @@ readSparse8(pointer Base, register unsigned long Offset) } static int -readSparse16(pointer Base, register unsigned long Offset) +readSparse16(void *Base, register unsigned long Offset) { register unsigned long result, shift; register unsigned long msb; @@ -757,7 +757,7 @@ readSparse16(pointer Base, register unsigned long Offset) } static int -readSparse32(pointer Base, register unsigned long Offset) +readSparse32(void *Base, register unsigned long Offset) { /* NOTE: this is really using DENSE. */ mem_barrier(); @@ -765,7 +765,7 @@ readSparse32(pointer Base, register unsigned long Offset) } static void -writeSparse8(int Value, pointer Base, register unsigned long Offset) +writeSparse8(int Value, void *Base, register unsigned long Offset) { register unsigned long msb; register unsigned int b = Value & 0xffU; @@ -786,7 +786,7 @@ writeSparse8(int Value, pointer Base, register unsigned long Offset) } static void -writeSparse16(int Value, pointer Base, register unsigned long Offset) +writeSparse16(int Value, void *Base, register unsigned long Offset) { register unsigned long msb; register unsigned int w = Value & 0xffffU; @@ -807,7 +807,7 @@ writeSparse16(int Value, pointer Base, register unsigned long Offset) } static void -writeSparse32(int Value, pointer Base, register unsigned long Offset) +writeSparse32(int Value, void *Base, register unsigned long Offset) { /* NOTE: this is really using DENSE. */ write_mem_barrier(); @@ -816,7 +816,7 @@ writeSparse32(int Value, pointer Base, register unsigned long Offset) } static void -writeSparseNB8(int Value, pointer Base, register unsigned long Offset) +writeSparseNB8(int Value, void *Base, register unsigned long Offset) { register unsigned long msb; register unsigned int b = Value & 0xffU; @@ -834,7 +834,7 @@ writeSparseNB8(int Value, pointer Base, register unsigned long Offset) } static void -writeSparseNB16(int Value, pointer Base, register unsigned long Offset) +writeSparseNB16(int Value, void *Base, register unsigned long Offset) { register unsigned long msb; register unsigned int w = Value & 0xffffU; @@ -852,30 +852,30 @@ writeSparseNB16(int Value, pointer Base, register unsigned long Offset) } static void -writeSparseNB32(int Value, pointer Base, register unsigned long Offset) +writeSparseNB32(int Value, void *Base, register unsigned long Offset) { /* NOTE: this is really using DENSE. */ *(vuip) ((unsigned long) Base + (Offset)) = Value; return; } -void (*xf86WriteMmio8) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmio8) (int Value, void *Base, unsigned long Offset) = writeDense8; -void (*xf86WriteMmio16) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmio16) (int Value, void *Base, unsigned long Offset) = writeDense16; -void (*xf86WriteMmio32) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmio32) (int Value, void *Base, unsigned long Offset) = writeDense32; -void (*xf86WriteMmioNB8) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmioNB8) (int Value, void *Base, unsigned long Offset) = writeDenseNB8; -void (*xf86WriteMmioNB16) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmioNB16) (int Value, void *Base, unsigned long Offset) = writeDenseNB16; -void (*xf86WriteMmioNB32) (int Value, pointer Base, unsigned long Offset) +void (*xf86WriteMmioNB32) (int Value, void *Base, unsigned long Offset) = writeDenseNB32; -int (*xf86ReadMmio8) (pointer Base, unsigned long Offset) +int (*xf86ReadMmio8) (void *Base, unsigned long Offset) = readDense8; -int (*xf86ReadMmio16) (pointer Base, unsigned long Offset) +int (*xf86ReadMmio16) (void *Base, unsigned long Offset) = readDense16; -int (*xf86ReadMmio32) (pointer Base, unsigned long Offset) +int (*xf86ReadMmio32) (void *Base, unsigned long Offset) = readDense32; #endif /* __alpha__ */ diff --git a/xorg-server/hw/xfree86/os-support/shared/vidmem.c b/xorg-server/hw/xfree86/os-support/shared/vidmem.c index 68ed30e41..f473293c7 100644 --- a/xorg-server/hw/xfree86/os-support/shared/vidmem.c +++ b/xorg-server/hw/xfree86/os-support/shared/vidmem.c @@ -51,8 +51,8 @@ typedef struct { unsigned long size; - pointer virtBase; - pointer mtrrInfo; + void *virtBase; + void *mtrrInfo; } MappingRec, *MappingPtr; typedef struct { @@ -104,7 +104,7 @@ newMapping(VidMapPtr vp) } static MappingPtr -findMapping(VidMapPtr vp, pointer vbase, unsigned long size) +findMapping(VidMapPtr vp, void *vbase, unsigned long size) { int i; @@ -165,10 +165,10 @@ xf86InitVidMem(void) } } -pointer +void * xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size) { - pointer vbase = NULL; + void *vbase = NULL; VidMapPtr vp; MappingPtr mp; @@ -182,7 +182,7 @@ xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size) vbase = vidMemInfo.mapMem(ScreenNum, Base, Size, Flags); - if (!vbase || vbase == (pointer) -1) + if (!vbase || vbase == (void *) -1) return NULL; vp = getVidMapRec(ScreenNum); @@ -208,7 +208,7 @@ xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size) } void -xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size) +xf86UnMapVidMem(int ScreenNum, void *Base, unsigned long Size) { VidMapPtr vp; MappingPtr mp; diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_apm.c b/xorg-server/hw/xfree86/os-support/solaris/sun_apm.c index b6a1432f6..38fa5ecf2 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/sun_apm.c +++ b/xorg-server/hw/xfree86/os-support/solaris/sun_apm.c @@ -90,7 +90,7 @@ typedef struct apm_event_info { #define APM_DEVICE "/dev/srn" #define APM_DEVICE1 "/dev/apm" -static pointer APMihPtr = NULL; +static void *APMihPtr = NULL; static void sunCloseAPM(void); static struct { diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_init.c b/xorg-server/hw/xfree86/os-support/solaris/sun_init.c index 68527a577..16fc1b739 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/sun_init.c +++ b/xorg-server/hw/xfree86/os-support/solaris/sun_init.c @@ -316,7 +316,7 @@ xf86CloseConsole(void) " attributes (%s)\n", strerror(errno)); } else { - pointer fbdata; + void *fbdata; fbdata = mmap(NULL, fbattr.fbtype.fb_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_vid.c b/xorg-server/hw/xfree86/os-support/solaris/sun_vid.c index 67ef17689..fc464871d 100644 --- a/xorg-server/hw/xfree86/os-support/solaris/sun_vid.c +++ b/xorg-server/hw/xfree86/os-support/solaris/sun_vid.c @@ -107,10 +107,10 @@ solOpenAperture(void) return TRUE; } -static pointer +static void * solMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) { - pointer base; + void *base; int fd; int prot; @@ -144,7 +144,7 @@ solMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int Flags) /* ARGSUSED */ static void -solUnMapVidMem(int ScreenNum, pointer Base, unsigned long Size) +solUnMapVidMem(int ScreenNum, void *Base, unsigned long Size) { if (munmap(Base, Size) != 0) { xf86DrvMsgVerb(ScreenNum, X_WARNING, 0, diff --git a/xorg-server/hw/xfree86/os-support/xf86OSpriv.h b/xorg-server/hw/xfree86/os-support/xf86OSpriv.h index bd734f554..7f003e8ce 100644 --- a/xorg-server/hw/xfree86/os-support/xf86OSpriv.h +++ b/xorg-server/hw/xfree86/os-support/xf86OSpriv.h @@ -32,12 +32,12 @@ #ifndef _XF86OSPRIV_H #define _XF86OSPRIV_H -typedef pointer (*MapMemProcPtr) (int, unsigned long, unsigned long, int); -typedef void (*UnmapMemProcPtr) (int, pointer, unsigned long); -typedef pointer (*SetWCProcPtr) (int, unsigned long, unsigned long, Bool, +typedef void *(*MapMemProcPtr) (int, unsigned long, unsigned long, int); +typedef void (*UnmapMemProcPtr) (int, void *, unsigned long); +typedef void *(*SetWCProcPtr) (int, unsigned long, unsigned long, Bool, MessageType); -typedef void (*ProtectMemProcPtr) (int, pointer, unsigned long, Bool); -typedef void (*UndoWCProcPtr) (int, pointer); +typedef void (*ProtectMemProcPtr) (int, void *, unsigned long, Bool); +typedef void (*UndoWCProcPtr) (int, void *); typedef struct { Bool initialised; diff --git a/xorg-server/hw/xfree86/os-support/xf86_OSproc.h b/xorg-server/hw/xfree86/os-support/xf86_OSproc.h index 106168aba..8d27e8b7b 100644 --- a/xorg-server/hw/xfree86/os-support/xf86_OSproc.h +++ b/xorg-server/hw/xfree86/os-support/xf86_OSproc.h @@ -132,9 +132,9 @@ _XFUNCPROTOBEGIN /* public functions */ extern _X_EXPORT Bool xf86LinearVidMem(void); extern _X_EXPORT _X_DEPRECATED Bool xf86CheckMTRR(int); -extern _X_EXPORT _X_DEPRECATED pointer xf86MapVidMem(int, int, unsigned long, +extern _X_EXPORT _X_DEPRECATED void *xf86MapVidMem(int, int, unsigned long, unsigned long); -extern _X_EXPORT _X_DEPRECATED void xf86UnMapVidMem(int, pointer, +extern _X_EXPORT _X_DEPRECATED void xf86UnMapVidMem(int, void *, unsigned long); extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, int); diff --git a/xorg-server/hw/xfree86/parser/Configint.h b/xorg-server/hw/xfree86/parser/Configint.h index 81cc1fc59..62e514201 100644 --- a/xorg-server/hw/xfree86/parser/Configint.h +++ b/xorg-server/hw/xfree86/parser/Configint.h @@ -90,7 +90,7 @@ typedef struct { #include "configProcs.h" #include <stdlib.h> -#define TestFree(a) if (a) { free (a); a = NULL; } +#define TestFree(a) if (a) { free ((void *) a); a = NULL; } #define parsePrologue(typeptr,typerec) typeptr ptr; \ if( (ptr=calloc(1,sizeof(typerec))) == NULL ) { return NULL; } diff --git a/xorg-server/hw/xfree86/parser/Files.c b/xorg-server/hw/xfree86/parser/Files.c index 0d3e47ac5..a6e18dd2c 100644 --- a/xorg-server/hw/xfree86/parser/Files.c +++ b/xorg-server/hw/xfree86/parser/Files.c @@ -97,8 +97,7 @@ xf86parseFilesSection(void) j = FALSE; str = val.str; if (ptr->file_fontpath == NULL) { - ptr->file_fontpath = malloc(1); - ptr->file_fontpath[0] = '\0'; + ptr->file_fontpath = calloc(1, 1); i = strlen(str) + 1; } else { diff --git a/xorg-server/hw/xfree86/parser/Flags.c b/xorg-server/hw/xfree86/parser/Flags.c index 2461476d1..326c6b77d 100644 --- a/xorg-server/hw/xfree86/parser/Flags.c +++ b/xorg-server/hw/xfree86/parser/Flags.c @@ -189,7 +189,7 @@ xf86printServerFlagsSection(FILE * f, XF86ConfFlagsPtr flags) } static XF86OptionPtr -addNewOption2(XF86OptionPtr head, char *name, char *val, int used) +addNewOption2(XF86OptionPtr head, char *name, char *_val, int used) { XF86OptionPtr new, old = NULL; @@ -202,7 +202,7 @@ addNewOption2(XF86OptionPtr head, char *name, char *val, int used) else new = calloc(1, sizeof(*new)); new->opt_name = name; - new->opt_val = val; + new->opt_val = _val; new->opt_used = used; if (old) @@ -211,9 +211,9 @@ addNewOption2(XF86OptionPtr head, char *name, char *val, int used) } XF86OptionPtr -xf86addNewOption(XF86OptionPtr head, char *name, char *val) +xf86addNewOption(XF86OptionPtr head, char *name, char *_val) { - return addNewOption2(head, name, val, 0); + return addNewOption2(head, name, _val, 0); } void @@ -230,11 +230,11 @@ XF86OptionPtr xf86optionListDup(XF86OptionPtr opt) { XF86OptionPtr newopt = NULL; - char *val; + char *_val; while (opt) { - val = opt->opt_val ? strdup(opt->opt_val) : NULL; - newopt = xf86addNewOption(newopt, strdup(opt->opt_name), val); + _val = opt->opt_val ? strdup(opt->opt_val) : NULL; + newopt = xf86addNewOption(newopt, strdup(opt->opt_name), _val); newopt->opt_used = opt->opt_used; if (opt->opt_comment) newopt->opt_comment = strdup(opt->opt_comment); diff --git a/xorg-server/hw/xfree86/parser/InputClass.c b/xorg-server/hw/xfree86/parser/InputClass.c index de6a816ea..a7f573e70 100644 --- a/xorg-server/hw/xfree86/parser/InputClass.c +++ b/xorg-server/hw/xfree86/parser/InputClass.c @@ -64,7 +64,7 @@ xf86ConfigSymTabRec InputClassTab[] = { #define TOKEN_SEP "|" static void -add_group_entry(struct xorg_list *head, char **values) +add_group_entry(struct xorg_list *head, const char **values) { xf86MatchGroup *group; @@ -257,7 +257,7 @@ void xf86printInputClassSection(FILE * cf, XF86ConfInputClassPtr ptr) { const xf86MatchGroup *group; - char *const *cur; + const char *const *cur; while (ptr) { fprintf(cf, "Section \"InputClass\"\n"); @@ -363,7 +363,7 @@ xf86freeInputClassList(XF86ConfInputClassPtr ptr) while (ptr) { xf86MatchGroup *group, *next; - char **list; + const char **list; TestFree(ptr->identifier); TestFree(ptr->driver); @@ -371,55 +371,55 @@ xf86freeInputClassList(XF86ConfInputClassPtr ptr) xorg_list_for_each_entry_safe(group, next, &ptr->match_product, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_vendor, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_device, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_os, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_pnpid, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_usbid, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_tag, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } xorg_list_for_each_entry_safe(group, next, &ptr->match_layout, entry) { xorg_list_del(&group->entry); for (list = group->values; *list; list++) - free(*list); + free((void *) *list); free(group); } diff --git a/xorg-server/hw/xfree86/parser/Module.c b/xorg-server/hw/xfree86/parser/Module.c index 87ddfc635..243ba9195 100644 --- a/xorg-server/hw/xfree86/parser/Module.c +++ b/xorg-server/hw/xfree86/parser/Module.c @@ -218,7 +218,7 @@ xf86printModuleSection(FILE * cf, XF86ConfModulePtr ptr) } XF86LoadPtr -xf86addNewLoadDirective(XF86LoadPtr head, char *name, int type, +xf86addNewLoadDirective(XF86LoadPtr head, const char *name, int type, XF86OptionPtr opts) { XF86LoadPtr new; diff --git a/xorg-server/hw/xfree86/parser/configProcs.h b/xorg-server/hw/xfree86/parser/configProcs.h index 1250f3922..60509dcd8 100644 --- a/xorg-server/hw/xfree86/parser/configProcs.h +++ b/xorg-server/hw/xfree86/parser/configProcs.h @@ -67,7 +67,7 @@ int xf86validateLayout(XF86ConfigPtr p); XF86ConfModulePtr xf86parseModuleSection(void); void xf86printModuleSection(FILE * cf, XF86ConfModulePtr ptr); extern _X_EXPORT XF86LoadPtr xf86addNewLoadDirective(XF86LoadPtr head, - char *name, int type, + const char *name, int type, XF86OptionPtr opts); void xf86freeModules(XF86ConfModulePtr ptr); @@ -141,7 +141,7 @@ xf86freeExtensions(XF86ConfExtensionsPtr ptr); #include <xorg-config.h> #endif -#ifndef IN_XSERVER +#ifndef HAVE_XORG_CONFIG_H /* Externally provided functions */ void ErrorF(const char *f, ...); diff --git a/xorg-server/hw/xfree86/parser/scan.c b/xorg-server/hw/xfree86/parser/scan.c index f852b83ec..55a84426d 100644 --- a/xorg-server/hw/xfree86/parser/scan.c +++ b/xorg-server/hw/xfree86/parser/scan.c @@ -820,7 +820,7 @@ static char * OpenConfigDir(const char *path, const char *cmdline, const char *projroot, const char *confname) { - char *dirpath, *pathcopy; + char *dirpath = NULL, *pathcopy; const char *template; Bool found = FALSE; int cmdlineUsed = 0; @@ -1078,9 +1078,10 @@ xf86nameCompare(const char *s1, const char *s2) } char * -xf86addComment(char *cur, char *add) +xf86addComment(char *cur, const char *add) { char *str; + const char *cstr; int len, curlen, iscomment, hasnewline = 0, insnewline, endnewline; if (add == NULL || add[0] == '\0') @@ -1095,14 +1096,14 @@ xf86addComment(char *cur, char *add) else curlen = 0; - str = add; + cstr = add; iscomment = 0; - while (*str) { - if (*str != ' ' && *str != '\t') + while (*cstr) { + if (*cstr != ' ' && *cstr != '\t') break; - ++str; + ++cstr; } - iscomment = (*str == '#'); + iscomment = (*cstr == '#'); len = strlen(add); endnewline = add[len - 1] == '\n'; diff --git a/xorg-server/hw/xfree86/parser/xf86Parser.h b/xorg-server/hw/xfree86/parser/xf86Parser.h index e7210e811..83607f26c 100644 --- a/xorg-server/hw/xfree86/parser/xf86Parser.h +++ b/xorg-server/hw/xfree86/parser/xf86Parser.h @@ -85,7 +85,7 @@ typedef struct { typedef struct { GenericListRec list; int load_type; - char *load_name; + const char *load_name; XF86OptionPtr load_opt; char *load_comment; int ignore; @@ -116,7 +116,7 @@ typedef struct { typedef struct { GenericListRec list; - char *ml_identifier; + const char *ml_identifier; int ml_clock; int ml_hdisplay; int ml_hsyncstart; @@ -134,21 +134,21 @@ typedef struct { typedef struct { GenericListRec list; - char *vp_identifier; + const char *vp_identifier; XF86OptionPtr vp_option_lst; char *vp_comment; } XF86ConfVideoPortRec, *XF86ConfVideoPortPtr; typedef struct { GenericListRec list; - char *va_identifier; - char *va_vendor; - char *va_board; - char *va_busid; - char *va_driver; + const char *va_identifier; + const char *va_vendor; + const char *va_board; + const char *va_busid; + const char *va_driver; XF86OptionPtr va_option_lst; XF86ConfVideoPortPtr va_port_lst; - char *va_fwdref; + const char *va_fwdref; char *va_comment; } XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr; @@ -165,21 +165,21 @@ typedef struct { typedef struct { GenericListRec list; - char *modes_identifier; + const char *modes_identifier; XF86ConfModeLinePtr mon_modeline_lst; char *modes_comment; } XF86ConfModesRec, *XF86ConfModesPtr; typedef struct { GenericListRec list; - char *ml_modes_str; + const char *ml_modes_str; XF86ConfModesPtr ml_modes; } XF86ConfModesLinkRec, *XF86ConfModesLinkPtr; typedef struct { GenericListRec list; - char *mon_identifier; - char *mon_vendor; + const char *mon_identifier; + const char *mon_vendor; char *mon_modelname; int mon_width; /* in mm */ int mon_height; /* in mm */ @@ -201,21 +201,21 @@ typedef struct { typedef struct { GenericListRec list; - char *dev_identifier; - char *dev_vendor; - char *dev_board; - char *dev_chipset; - char *dev_busid; - char *dev_card; - char *dev_driver; - char *dev_ramdac; + const char *dev_identifier; + const char *dev_vendor; + const char *dev_board; + const char *dev_chipset; + const char *dev_busid; + const char *dev_card; + const char *dev_driver; + const char *dev_ramdac; int dev_dacSpeeds[CONF_MAXDACSPEEDS]; int dev_videoram; int dev_textclockfreq; unsigned long dev_bios_base; unsigned long dev_mem_base; unsigned long dev_io_base; - char *dev_clockchip; + const char *dev_clockchip; int dev_clocks; int dev_clock[CONF_MAXCLOCKS]; int dev_chipid; @@ -228,7 +228,7 @@ typedef struct { typedef struct { GenericListRec list; - char *mode_name; + const char *mode_name; } XF86ModeRec, *XF86ModePtr; typedef struct { @@ -239,7 +239,7 @@ typedef struct { int disp_virtualY; int disp_depth; int disp_bpp; - char *disp_visual; + const char *disp_visual; parser_rgb disp_weight; parser_rgb disp_black; parser_rgb disp_white; @@ -255,20 +255,20 @@ typedef struct { typedef struct { GenericListRec list; - char *al_adaptor_str; + const char *al_adaptor_str; XF86ConfVideoAdaptorPtr al_adaptor; } XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr; typedef struct { GenericListRec list; - char *scrn_identifier; - char *scrn_obso_driver; + const char *scrn_identifier; + const char *scrn_obso_driver; int scrn_defaultdepth; int scrn_defaultbpp; int scrn_defaultfbbpp; - char *scrn_monitor_str; + const char *scrn_monitor_str; XF86ConfMonitorPtr scrn_monitor; - char *scrn_device_str; + const char *scrn_device_str; XF86ConfDevicePtr scrn_device; XF86ConfAdaptorLinkPtr scrn_adaptor_lst; XF86ConfDisplayPtr scrn_display_lst; @@ -279,8 +279,8 @@ typedef struct { typedef struct { GenericListRec list; - char *inp_identifier; - char *inp_driver; + const char *inp_identifier; + const char *inp_driver; XF86OptionPtr inp_option_lst; char *inp_comment; } XF86ConfInputRec, *XF86ConfInputPtr; @@ -288,7 +288,7 @@ typedef struct { typedef struct { GenericListRec list; XF86ConfInputPtr iref_inputdev; - char *iref_inputdev_str; + const char *iref_inputdev_str; XF86OptionPtr iref_option_lst; } XF86ConfInputrefRec, *XF86ConfInputrefPtr; @@ -299,13 +299,13 @@ typedef struct { typedef struct { struct xorg_list entry; - char **values; + const char **values; } xf86MatchGroup; typedef struct { GenericListRec list; char *identifier; - char *driver; + const char *driver; struct xorg_list match_product; struct xorg_list match_vendor; struct xorg_list match_device; @@ -338,30 +338,30 @@ typedef struct { GenericListRec list; int adj_scrnum; XF86ConfScreenPtr adj_screen; - char *adj_screen_str; + const char *adj_screen_str; XF86ConfScreenPtr adj_top; - char *adj_top_str; + const char *adj_top_str; XF86ConfScreenPtr adj_bottom; - char *adj_bottom_str; + const char *adj_bottom_str; XF86ConfScreenPtr adj_left; - char *adj_left_str; + const char *adj_left_str; XF86ConfScreenPtr adj_right; - char *adj_right_str; + const char *adj_right_str; int adj_where; int adj_x; int adj_y; - char *adj_refscreen; + const char *adj_refscreen; } XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr; typedef struct { GenericListRec list; - char *inactive_device_str; + const char *inactive_device_str; XF86ConfDevicePtr inactive_device; } XF86ConfInactiveRec, *XF86ConfInactivePtr; typedef struct { GenericListRec list; - char *lay_identifier; + const char *lay_identifier; XF86ConfAdjacencyPtr lay_adjacency_lst; XF86ConfInactivePtr lay_inactive_lst; XF86ConfInputrefPtr lay_input_lst; @@ -371,22 +371,22 @@ typedef struct { typedef struct { GenericListRec list; - char *vs_name; - char *vs_identifier; + const char *vs_name; + const char *vs_identifier; XF86OptionPtr vs_option_lst; char *vs_comment; } XF86ConfVendSubRec, *XF86ConfVendSubPtr; typedef struct { GenericListRec list; - char *vnd_identifier; + const char *vnd_identifier; XF86OptionPtr vnd_option_lst; XF86ConfVendSubPtr vnd_sub_lst; char *vnd_comment; } XF86ConfVendorRec, *XF86ConfVendorPtr; typedef struct { - char *dri_group_name; + const char *dri_group_name; int dri_group; int dri_mode; char *dri_comment; @@ -462,7 +462,7 @@ extern _X_EXPORT int xf86itemNotSublist(GenericListPtr list_1, extern _X_EXPORT int xf86pathIsAbsolute(const char *path); extern _X_EXPORT int xf86pathIsSafe(const char *path); -extern _X_EXPORT char *xf86addComment(char *cur, char *add); +extern _X_EXPORT char *xf86addComment(char *cur, const char *add); extern _X_EXPORT Bool xf86getBoolValue(Bool *val, const char *str); #endif /* _xf86Parser_h_ */ diff --git a/xorg-server/hw/xfree86/ramdac/xf86CursorPriv.h b/xorg-server/hw/xfree86/ramdac/xf86CursorPriv.h index 04be14135..a5d2aabc3 100644 --- a/xorg-server/hw/xfree86/ramdac/xf86CursorPriv.h +++ b/xorg-server/hw/xfree86/ramdac/xf86CursorPriv.h @@ -34,7 +34,7 @@ typedef struct { int ForceHWCursorCount; Bool HWCursorForced; - pointer transparentData; + void *transparentData; } xf86CursorScreenRec, *xf86CursorScreenPtr; void xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y); diff --git a/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c b/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c index 197abff8f..3b69698db 100644 --- a/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c +++ b/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c @@ -462,9 +462,9 @@ RealizeCursorInterleave16(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) } /* 16 bit interleave */ - DstS = (pointer) mem2; + DstS = (void *) mem2; DstM = DstS + (size >> 2); - pntr = (pointer) mem; + pntr = (void *) mem; count = (size >> 1); while (count) { *pntr++ = *DstS++; @@ -497,9 +497,9 @@ RealizeCursorInterleave32(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) } /* 32 bit interleave */ - DstS = (pointer) mem2; + DstS = (void *) mem2; DstM = DstS + (size >> 3); - pntr = (pointer) mem; + pntr = (void *) mem; count = (size >> 2); while (count) { *pntr++ = *DstS++; @@ -532,9 +532,9 @@ RealizeCursorInterleave64(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) } /* 64 bit interleave */ - DstS = (pointer) mem2; + DstS = (void *) mem2; DstM = DstS + (size >> 3); - pntr = (pointer) mem; + pntr = (void *) mem; count = (size >> 2); while (count) { *pntr++ = *DstS++; diff --git a/xorg-server/hw/xfree86/sdksyms.sh b/xorg-server/hw/xfree86/sdksyms.sh index d7f259d28..d9a44788c 100644 --- a/xorg-server/hw/xfree86/sdksyms.sh +++ b/xorg-server/hw/xfree86/sdksyms.sh @@ -261,6 +261,7 @@ cat > sdksyms.c << EOF #include "dix.h" #include "dixaccess.h" #include "dixevents.h" +#define _FONTPROTO_H #include "dixfont.h" #include "dixfontstr.h" #include "dixfontstubs.h" diff --git a/xorg-server/hw/xfree86/shadowfb/shadow.c b/xorg-server/hw/xfree86/shadowfb/shadow.c index 614501770..43529398a 100644 --- a/xorg-server/hw/xfree86/shadowfb/shadow.c +++ b/xorg-server/hw/xfree86/shadowfb/shadow.c @@ -62,8 +62,8 @@ typedef struct { } ShadowScreenRec, *ShadowScreenPtr; typedef struct { - GCOps *ops; - GCFuncs *funcs; + const GCOps *ops; + const GCFuncs *funcs; } ShadowGCRec, *ShadowGCPtr; static DevPrivateKeyRec ShadowScreenKeyRec; @@ -96,7 +96,7 @@ static DevPrivateKeyRec ShadowGCKeyRec; #define SHADOW_GC_OP_PROLOGUE(pGC)\ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pGC->pScreen); \ ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);\ - GCFuncs *oldFuncs = pGC->funcs;\ + const GCFuncs *oldFuncs = pGC->funcs;\ pGC->funcs = pGCPriv->funcs;\ pGC->ops = pGCPriv->ops @@ -243,7 +243,7 @@ ShadowCloseScreen(ScreenPtr pScreen) ps->Composite = pPriv->Composite; } - free((pointer) pPriv); + free((void *) pPriv); return (*pScreen->CloseScreen) (pScreen); } @@ -342,7 +342,7 @@ static void ShadowValidateGC(GCPtr, unsigned long, DrawablePtr); static void ShadowChangeGC(GCPtr, unsigned long); static void ShadowCopyGC(GCPtr, unsigned long, GCPtr); static void ShadowDestroyGC(GCPtr); -static void ShadowChangeClip(GCPtr, int, pointer, int); +static void ShadowChangeClip(GCPtr, int, void *, int); static void ShadowDestroyClip(GCPtr); static void ShadowCopyClip(GCPtr, GCPtr); @@ -409,7 +409,7 @@ ShadowCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) } static void -ShadowChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +ShadowChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { SHADOW_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); @@ -1477,7 +1477,7 @@ ShadowImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int x, int y, unsigned int nglyphInit, - CharInfoPtr * ppciInit, pointer pglyphBase) + CharInfoPtr * ppciInit, void *pglyphBase) { BoxRec box; Bool boxNotEmpty = FALSE; @@ -1538,7 +1538,7 @@ ShadowPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int x, int y, unsigned int nglyphInit, - CharInfoPtr * ppciInit, pointer pglyphBase) + CharInfoPtr * ppciInit, void *pglyphBase) { BoxRec box; Bool boxNotEmpty = FALSE; diff --git a/xorg-server/hw/xfree86/utils/cvt/cvt.c b/xorg-server/hw/xfree86/utils/cvt/cvt.c index 5e2888e94..d5df17fd9 100644 --- a/xorg-server/hw/xfree86/utils/cvt/cvt.c +++ b/xorg-server/hw/xfree86/utils/cvt/cvt.c @@ -39,10 +39,10 @@ FatalError(const char *f, ...) } /* xnfalloc implementation used by the server code we built in */ -pointer +void * XNFalloc(unsigned long n) { - pointer r; + void *r; r = malloc(n); if (!r) { @@ -53,10 +53,10 @@ XNFalloc(unsigned long n) } /* xnfcalloc implementation used by the server code we built in */ -pointer +void * XNFcalloc(unsigned long n) { - pointer r; + void *r; r = calloc(1, n); if (!r) { diff --git a/xorg-server/hw/xfree86/vbe/vbe.c b/xorg-server/hw/xfree86/vbe/vbe.c index 39f0cefb6..d41e61ba8 100644 --- a/xorg-server/hw/xfree86/vbe/vbe.c +++ b/xorg-server/hw/xfree86/vbe/vbe.c @@ -50,7 +50,7 @@ vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags) { int RealOff; - pointer page = NULL; + void *page = NULL; ScrnInfoPtr pScrn = xf86FindScreenForEntity(entityIndex); vbeControllerInfoPtr vbe = NULL; Bool init_int10 = FALSE; @@ -259,7 +259,7 @@ static unsigned char * vbeReadEDID(vbeInfoPtr pVbe) { int RealOff = pVbe->real_mode_base; - pointer page = pVbe->memory; + void *page = pVbe->memory; unsigned char *tmp = NULL; Bool novbe = FALSE; Bool noddc = FALSE; @@ -319,7 +319,7 @@ vbeReadEDID(vbeInfoPtr pVbe) } xf86MonPtr -vbeDoEDID(vbeInfoPtr pVbe, pointer unused) +vbeDoEDID(vbeInfoPtr pVbe, void *unused) { unsigned char *DDC_data = NULL; @@ -545,7 +545,7 @@ VBEFreeModeInfo(VbeModeInfoBlock * block) Bool VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function, - pointer *memory, int *size, int *real_mode_pages) + void **memory, int *size, int *real_mode_pages) { /* Input: @@ -929,7 +929,7 @@ VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr, memcpy(vbe_sr->state, vbe_sr->pstate, vbe_sr->stateSize); ErrorF("VBESaveRestore\n"); if ((VBESaveRestore(pVbe, function, - (pointer) &vbe_sr->state, + (void *) &vbe_sr->state, &vbe_sr->stateSize, &vbe_sr->statePage))) { if (function == MODE_SAVE) { SaveSucc = TRUE; @@ -1055,7 +1055,7 @@ struct vbePanelID * VBEReadPanelID(vbeInfoPtr pVbe) { int RealOff = pVbe->real_mode_base; - pointer page = pVbe->memory; + void *page = pVbe->memory; void *tmp = NULL; int screen = pVbe->pInt10->pScrn->scrnIndex; diff --git a/xorg-server/hw/xfree86/vbe/vbe.h b/xorg-server/hw/xfree86/vbe/vbe.h index 3907c53f3..bc3653334 100644 --- a/xorg-server/hw/xfree86/vbe/vbe.h +++ b/xorg-server/hw/xfree86/vbe/vbe.h @@ -25,7 +25,7 @@ typedef enum { typedef struct { xf86Int10InfoPtr pInt10; int version; - pointer memory; + void *memory; int real_mode_base; int num_pages; Bool init_int10; @@ -40,7 +40,7 @@ extern _X_EXPORT vbeInfoPtr VBEInit(xf86Int10InfoPtr pInt, int entityIndex); extern _X_EXPORT vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags); extern _X_EXPORT void vbeFree(vbeInfoPtr pVbe); -extern _X_EXPORT xf86MonPtr vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule); +extern _X_EXPORT xf86MonPtr vbeDoEDID(vbeInfoPtr pVbe, void *pDDCModule); #pragma pack(1) @@ -227,7 +227,7 @@ typedef enum { extern _X_EXPORT Bool VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction fuction, - pointer *memory, int *size, int *real_mode_pages); + void **memory, int *size, int *real_mode_pages); /* * INT 5 diff --git a/xorg-server/hw/xfree86/vbe/vbeModes.c b/xorg-server/hw/xfree86/vbe/vbeModes.c index 415167d0e..50ac50d2c 100644 --- a/xorg-server/hw/xfree86/vbe/vbeModes.c +++ b/xorg-server/hw/xfree86/vbe/vbeModes.c @@ -356,8 +356,10 @@ VBESetModeNames(DisplayModePtr pMode) pMode->name = strdup("BADMODE"); } else { - XNFasprintf(&pMode->name, "%dx%d", + char *tmp; + XNFasprintf(&tmp, "%dx%d", pMode->HDisplay, pMode->VDisplay); + pMode->name = tmp; } } pMode = pMode->next; @@ -433,7 +435,7 @@ VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe) */ int VBEValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, - char **modeNames, ClockRangePtr clockRanges, + const char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int pitchInc, int minHeight, int maxHeight, int virtualX, int virtualY, int apertureSize, LookupModeFlags strategy) diff --git a/xorg-server/hw/xfree86/vbe/vbeModes.h b/xorg-server/hw/xfree86/vbe/vbeModes.h index affd5b639..ee0257c15 100644 --- a/xorg-server/hw/xfree86/vbe/vbeModes.h +++ b/xorg-server/hw/xfree86/vbe/vbeModes.h @@ -82,7 +82,7 @@ extern _X_EXPORT void VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe); */ extern _X_EXPORT int VBEValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, - char **modeNames, + const char **modeNames, ClockRangePtr clockRanges, int *linePitches, int minPitch, int maxPitch, int pitchInc, int minHeight, diff --git a/xorg-server/hw/xfree86/vgahw/vgaCmap.c b/xorg-server/hw/xfree86/vgahw/vgaCmap.c index e7a0d023e..6e028a7f5 100644 --- a/xorg-server/hw/xfree86/vgahw/vgaCmap.c +++ b/xorg-server/hw/xfree86/vgahw/vgaCmap.c @@ -252,7 +252,7 @@ ColormapPtr pmap; if (pmap != GetInstalledmiColormap(pmap->pScreen)) return; - dixLookupResourceByType((pointer *) &defColormap, + dixLookupResourceByType((void **) &defColormap, pmap->pScreen->defColormap, RT_COLORMAP, serverClient, DixInstallAccess); diff --git a/xorg-server/hw/xfree86/vgahw/vgaHW.h b/xorg-server/hw/xfree86/vgahw/vgaHW.h index 937a8a507..63a10f42b 100644 --- a/xorg-server/hw/xfree86/vgahw/vgaHW.h +++ b/xorg-server/hw/xfree86/vgahw/vgaHW.h @@ -107,18 +107,18 @@ typedef void (*vgaHWMiscProcPtr) (vgaHWPtr hwp); * via the first 17 attribute registers and not the main 8-bit palette. */ typedef struct _vgaHWRec { - pointer Base; /* Address of "VGA" memory */ + void *Base; /* Address of "VGA" memory */ int MapSize; /* Size of "VGA" memory */ unsigned long MapPhys; /* phys location of VGA mem */ int IOBase; /* I/O Base address */ CARD8 *MMIOBase; /* Pointer to MMIO start */ int MMIOOffset; /* base + offset + vgareg = mmioreg */ - pointer FontInfo1; /* save area for fonts in + void *FontInfo1; /* save area for fonts in plane 2 */ - pointer FontInfo2; /* save area for fonts in + void *FontInfo2; /* save area for fonts in plane 3 */ - pointer TextInfo; /* save area for text */ + void *TextInfo; /* save area for text */ vgaRegRec SavedReg; /* saved registers */ vgaRegRec ModeReg; /* register settings for current mode */ @@ -148,7 +148,7 @@ typedef struct _vgaHWRec { vgaHWWriteProcPtr writeDacReadAddr; vgaHWWriteProcPtr writeDacData; vgaHWReadProcPtr readDacData; - pointer ddc; + void *ddc; struct pci_io_handle *io; vgaHWReadProcPtr readEnable; vgaHWWriteProcPtr writeEnable; diff --git a/xorg-server/hw/xfree86/x86emu/ops.c b/xorg-server/hw/xfree86/x86emu/ops.c index 76b83581f..8af1df47a 100644 --- a/xorg-server/hw/xfree86/x86emu/ops.c +++ b/xorg-server/hw/xfree86/x86emu/ops.c @@ -10189,8 +10189,8 @@ Handles opcode 0xe8 static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1)) { - s16 ip16; - s32 ip32; + s16 ip16 = 0; + s32 ip32 = 0; START_OF_INSTR(); DECODE_PRINTF("CALL\t"); diff --git a/xorg-server/hw/xfree86/x86emu/x86emu/regs.h b/xorg-server/hw/xfree86/x86emu/x86emu/regs.h index 2ecafa047..3a7456e4c 100644 --- a/xorg-server/hw/xfree86/x86emu/x86emu/regs.h +++ b/xorg-server/hw/xfree86/x86emu/x86emu/regs.h @@ -39,6 +39,8 @@ #ifndef __X86EMU_REGS_H #define __X86EMU_REGS_H +#include <X11/Xfuncproto.h> + /*---------------------- Macros and type definitions ----------------------*/ #ifdef PACK @@ -337,7 +339,8 @@ extern "C" { /* Use "C" linkage when in C++ mode */ /* Function to log information at runtime */ - void printk(const char *fmt, ...); + void printk(const char *fmt, ...) + _X_ATTRIBUTE_PRINTF(1, 2); #ifdef __cplusplus } /* End of "C" linkage for C++ */ diff --git a/xorg-server/hw/xnest/Color.c b/xorg-server/hw/xnest/Color.c index 7ef137d59..95c334308 100644 --- a/xorg-server/hw/xnest/Color.c +++ b/xorg-server/hw/xnest/Color.c @@ -137,7 +137,7 @@ xnestDestroyColormap(ColormapPtr pCmap) (xnestWindow(pWin) != None && wColormap(pWin) == icws->cmapIDs[i]) static int -xnestCountInstalledColormapWindows(WindowPtr pWin, pointer ptr) +xnestCountInstalledColormapWindows(WindowPtr pWin, void *ptr) { xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *) ptr; int i; @@ -152,7 +152,7 @@ xnestCountInstalledColormapWindows(WindowPtr pWin, pointer ptr) } static int -xnestGetInstalledColormapWindows(WindowPtr pWin, pointer ptr) +xnestGetInstalledColormapWindows(WindowPtr pWin, void *ptr) { xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *) ptr; int i; @@ -198,12 +198,12 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) sizeof(Colormap)); icws.numCmapIDs = xnestListInstalledColormaps(pScreen, icws.cmapIDs); icws.numWindows = 0; - WalkTree(pScreen, xnestCountInstalledColormapWindows, (pointer) &icws); + WalkTree(pScreen, xnestCountInstalledColormapWindows, (void *) &icws); if (icws.numWindows) { icws.windows = (Window *) malloc((icws.numWindows + 1) * sizeof(Window)); icws.index = 0; - WalkTree(pScreen, xnestGetInstalledColormapWindows, (pointer) &icws); + WalkTree(pScreen, xnestGetInstalledColormapWindows, (void *) &icws); icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum]; numWindows = icws.numWindows + 1; } @@ -252,11 +252,11 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) visual = xnestVisualFromID(pScreen, wVisual(pWin)); if (visual == xnestDefaultVisual(pScreen)) - dixLookupResourceByType((pointer *) &pCmap, wColormap(pWin), + dixLookupResourceByType((void **) &pCmap, wColormap(pWin), RT_COLORMAP, serverClient, DixUseAccess); else - dixLookupResourceByType((pointer *) &pCmap, + dixLookupResourceByType((void **) &pCmap, pScreen->defColormap, RT_COLORMAP, serverClient, DixUseAccess); @@ -309,7 +309,7 @@ xnestDirectInstallColormaps(ScreenPtr pScreen) for (i = 0; i < n; i++) { ColormapPtr pCmap; - dixLookupResourceByType((pointer *) &pCmap, pCmapIDs[i], RT_COLORMAP, + dixLookupResourceByType((void **) &pCmap, pCmapIDs[i], RT_COLORMAP, serverClient, DixInstallAccess); if (pCmap) XInstallColormap(xnestDisplay, xnestColormap(pCmap)); @@ -330,7 +330,7 @@ xnestDirectUninstallColormaps(ScreenPtr pScreen) for (i = 0; i < n; i++) { ColormapPtr pCmap; - dixLookupResourceByType((pointer *) &pCmap, pCmapIDs[i], RT_COLORMAP, + dixLookupResourceByType((void **) &pCmap, pCmapIDs[i], RT_COLORMAP, serverClient, DixUninstallAccess); if (pCmap) XUninstallColormap(xnestDisplay, xnestColormap(pCmap)); @@ -347,10 +347,10 @@ xnestInstallColormap(ColormapPtr pCmap) /* Uninstall pInstalledMap. Notify all interested parties. */ if (pOldCmap != (ColormapPtr) None) - WalkTree(pCmap->pScreen, TellLostMap, (pointer) &pOldCmap->mid); + WalkTree(pCmap->pScreen, TellLostMap, (void *) &pOldCmap->mid); SetInstalledColormap(pCmap->pScreen, pCmap); - WalkTree(pCmap->pScreen, TellGainedMap, (pointer) &pCmap->mid); + WalkTree(pCmap->pScreen, TellGainedMap, (void *) &pCmap->mid); xnestSetInstalledColormapWindows(pCmap->pScreen); xnestDirectInstallColormaps(pCmap->pScreen); @@ -364,7 +364,7 @@ xnestUninstallColormap(ColormapPtr pCmap) if (pCmap == pCurCmap) { if (pCmap->mid != pCmap->pScreen->defColormap) { - dixLookupResourceByType((pointer *) &pCurCmap, + dixLookupResourceByType((void **) &pCurCmap, pCmap->pScreen->defColormap, RT_COLORMAP, serverClient, DixInstallAccess); diff --git a/xorg-server/hw/xnest/Font.c b/xorg-server/hw/xnest/Font.c index 1e95588ef..ffdfd2497 100644 --- a/xorg-server/hw/xnest/Font.c +++ b/xorg-server/hw/xnest/Font.c @@ -35,7 +35,7 @@ int xnestFontPrivateIndex; Bool xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont) { - pointer priv; + void *priv; Atom name_atom, value_atom; int nprops; FontPropPtr props; @@ -64,7 +64,7 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont) if (!name) return False; - priv = (pointer) malloc(sizeof(xnestPrivFont)); + priv = (void *) malloc(sizeof(xnestPrivFont)); FontSetPrivate(pFont, xnestFontPrivateIndex, priv); xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name); diff --git a/xorg-server/hw/xnest/GC.c b/xorg-server/hw/xnest/GC.c index cfaf71475..0ec60fcdc 100644 --- a/xorg-server/hw/xnest/GC.c +++ b/xorg-server/hw/xnest/GC.c @@ -188,7 +188,7 @@ xnestDestroyGC(GCPtr pGC) } void -xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) +xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects) { int i, size; BoxPtr pBox; @@ -225,7 +225,7 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) * current pixmap contents. */ pGC->clientClip = - (pointer) (*pGC->pScreen->BitmapToRegion) ((PixmapPtr) pValue); + (void *) (*pGC->pScreen->BitmapToRegion) ((PixmapPtr) pValue); (*pGC->pScreen->DestroyPixmap) ((PixmapPtr) pValue); pValue = pGC->clientClip; type = CT_REGION; @@ -269,7 +269,7 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) * other parts of server can only deal with CT_NONE, * CT_PIXMAP and CT_REGION client clips. */ - pGC->clientClip = (pointer) RegionFromRects(nRects, + pGC->clientClip = (void *) RegionFromRects(nRects, (xRectangle *) pValue, type); free(pValue); diff --git a/xorg-server/hw/xnest/GCOps.c b/xorg-server/hw/xnest/GCOps.c index d00511d71..fa602314b 100644 --- a/xorg-server/hw/xnest/GCOps.c +++ b/xorg-server/hw/xnest/GCOps.c @@ -308,7 +308,7 @@ xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, void xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nGlyphs, CharInfoPtr * pCharInfo, - pointer pGlyphBase) + void *pGlyphBase) { ErrorF("xnest warning: function xnestImageGlyphBlt not implemented\n"); } @@ -316,7 +316,7 @@ xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, void xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nGlyphs, CharInfoPtr * pCharInfo, - pointer pGlyphBase) + void *pGlyphBase) { ErrorF("xnest warning: function xnestPolyGlyphBlt not implemented\n"); } diff --git a/xorg-server/hw/xnest/GCOps.h b/xorg-server/hw/xnest/GCOps.h index b1cad110c..fd1f6bfc2 100644 --- a/xorg-server/hw/xnest/GCOps.h +++ b/xorg-server/hw/xnest/GCOps.h @@ -58,10 +58,10 @@ void xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *string); void xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nGlyphs, CharInfoPtr * pCharInfo, - pointer pGlyphBase); + void *pGlyphBase); void xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nGlyphs, CharInfoPtr * pCharInfo, - pointer pGlyphBase); + void *pGlyphBase); void xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int width, int height, int x, int y); diff --git a/xorg-server/hw/xnest/Handlers.c b/xorg-server/hw/xnest/Handlers.c index 4605b90bd..05d559d8f 100644 --- a/xorg-server/hw/xnest/Handlers.c +++ b/xorg-server/hw/xnest/Handlers.c @@ -32,14 +32,14 @@ is" without express or implied warranty. #include "Handlers.h" void -xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask) +xnestBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask) { xnestCollectExposures(); XFlush(xnestDisplay); } void -xnestWakeupHandler(pointer blockData, int result, pointer pReadMask) +xnestWakeupHandler(void *blockData, int result, void *pReadMask) { xnestCollectEvents(); } diff --git a/xorg-server/hw/xnest/Handlers.h b/xorg-server/hw/xnest/Handlers.h index 7160bdd13..d4ad6d254 100644 --- a/xorg-server/hw/xnest/Handlers.h +++ b/xorg-server/hw/xnest/Handlers.h @@ -15,8 +15,8 @@ is" without express or implied warranty. #ifndef XNESTHANDLERS_H #define XNESTHANDLERS_H -void xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, - pointer pReadMask); -void xnestWakeupHandler(pointer blockData, int result, pointer pReadMask); +void xnestBlockHandler(void *blockData, OSTimePtr pTimeout, + void *pReadMask); +void xnestWakeupHandler(void *blockData, int result, void *pReadMask); #endif /* XNESTHANDLERS_H */ diff --git a/xorg-server/hw/xnest/Keyboard.c b/xorg-server/hw/xnest/Keyboard.c index d013dc91e..2cf16246b 100644 --- a/xorg-server/hw/xnest/Keyboard.c +++ b/xorg-server/hw/xnest/Keyboard.c @@ -59,7 +59,7 @@ extern Status XkbGetControls(Display * /* dpy */ , DeviceIntPtr xnestKeyboardDevice = NULL; void -xnestBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls) +xnestBell(int volume, DeviceIntPtr pDev, void *ctrl, int cls) { XBell(xnestDisplay, volume); } diff --git a/xorg-server/hw/xnest/Keyboard.h b/xorg-server/hw/xnest/Keyboard.h index 45d56bc08..dc5eaa2de 100644 --- a/xorg-server/hw/xnest/Keyboard.h +++ b/xorg-server/hw/xnest/Keyboard.h @@ -20,7 +20,7 @@ is" without express or implied warranty. extern DeviceIntPtr xnestKeyboardDevice; -void xnestBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls); +void xnestBell(int volume, DeviceIntPtr pDev, void *ctrl, int cls); void xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl * ctrl); int xnestKeyboardProc(DeviceIntPtr pDev, int onoff); void xnestUpdateModifierState(unsigned int state); diff --git a/xorg-server/hw/xnest/Pixmap.c b/xorg-server/hw/xnest/Pixmap.c index 2902acd56..6514f3b31 100644 --- a/xorg-server/hw/xnest/Pixmap.c +++ b/xorg-server/hw/xnest/Pixmap.c @@ -80,7 +80,7 @@ xnestDestroyPixmap(PixmapPtr pPixmap) Bool xnestModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) + int bitsPerPixel, int devKind, void *pPixData) { if(!xnestPixmapPriv(pPixmap)->pixmap && width > 0 && height > 0) { xnestPixmapPriv(pPixmap)->pixmap = diff --git a/xorg-server/hw/xnest/Window.c b/xorg-server/hw/xnest/Window.c index e2b21b58e..c33cbaa2b 100644 --- a/xorg-server/hw/xnest/Window.c +++ b/xorg-server/hw/xnest/Window.c @@ -42,7 +42,7 @@ is" without express or implied warranty. DevPrivateKeyRec xnestWindowPrivateKeyRec; static int -xnestFindWindowMatch(WindowPtr pWin, pointer ptr) +xnestFindWindowMatch(WindowPtr pWin, void *ptr) { xnestWindowMatch *wm = (xnestWindowMatch *) ptr; @@ -64,7 +64,7 @@ xnestWindowPtr(Window window) wm.window = window; for (i = 0; i < xnestNumScreens; i++) { - WalkTree(screenInfo.screens[i], xnestFindWindowMatch, (pointer) &wm); + WalkTree(screenInfo.screens[i], xnestFindWindowMatch, (void *) &wm); if (wm.pWin) break; } @@ -96,7 +96,7 @@ xnestCreateWindow(WindowPtr pWin) xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin)); mask |= CWColormap; if (pWin->optional->colormap) { - dixLookupResourceByType((pointer *) &pCmap, wColormap(pWin), + dixLookupResourceByType((void **) &pCmap, wColormap(pWin), RT_COLORMAP, serverClient, DixUseAccess); attributes.colormap = xnestColormap(pCmap); @@ -109,7 +109,7 @@ xnestCreateWindow(WindowPtr pWin) } else { /* root windows have their own colormaps at creation time */ visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin)); - dixLookupResourceByType((pointer *) &pCmap, wColormap(pWin), + dixLookupResourceByType((void **) &pCmap, wColormap(pWin), RT_COLORMAP, serverClient, DixUseAccess); mask |= CWColormap; attributes.colormap = xnestColormap(pCmap); @@ -331,7 +331,7 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask) if (mask & CWColormap) { ColormapPtr pCmap; - dixLookupResourceByType((pointer *) &pCmap, wColormap(pWin), + dixLookupResourceByType((void **) &pCmap, wColormap(pWin), RT_COLORMAP, serverClient, DixUseAccess); attributes.colormap = xnestColormap(pCmap); diff --git a/xorg-server/hw/xnest/XNGC.h b/xorg-server/hw/xnest/XNGC.h index c7c25e426..e2f10fb9c 100644 --- a/xorg-server/hw/xnest/XNGC.h +++ b/xorg-server/hw/xnest/XNGC.h @@ -35,7 +35,7 @@ void xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); void xnestChangeGC(GCPtr pGC, unsigned long mask); void xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); void xnestDestroyGC(GCPtr pGC); -void xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects); +void xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects); void xnestDestroyClip(GCPtr pGC); void xnestDestroyClipHelper(GCPtr pGC); void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc); diff --git a/xorg-server/hw/xnest/XNPixmap.h b/xorg-server/hw/xnest/XNPixmap.h index 5b2e796fe..b7b10e907 100644 --- a/xorg-server/hw/xnest/XNPixmap.h +++ b/xorg-server/hw/xnest/XNPixmap.h @@ -34,7 +34,7 @@ PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, unsigned usage_hint); Bool xnestDestroyPixmap(PixmapPtr pPixmap); Bool xnestModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData); + int bitsPerPixel, int devKind, void *pPixData); RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap); #endif /* XNESTPIXMAP_H */ diff --git a/xorg-server/hw/xquartz/applewm.c b/xorg-server/hw/xquartz/applewm.c index aea0a45f2..4409d4bf6 100644 --- a/xorg-server/hw/xquartz/applewm.c +++ b/xorg-server/hw/xquartz/applewm.c @@ -83,9 +83,9 @@ static XID eventResource; static unsigned int eventMask = 0; static int -WMFreeClient(pointer data, XID id); +WMFreeClient(void *data, XID id); static int -WMFreeEvents(pointer data, XID id); +WMFreeEvents(void *data, XID id); static void SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to); @@ -175,7 +175,7 @@ updateEventMask(WMEventPtr *pHead) /*ARGSUSED*/ static int -WMFreeClient(pointer data, XID id) +WMFreeClient(void *data, XID id) { WMEventPtr pEvent; WMEventPtr *pHead, pCur, pPrev; @@ -183,7 +183,7 @@ WMFreeClient(pointer data, XID id) pEvent = (WMEventPtr)data; i = dixLookupResourceByType( - (pointer *)&pHead, eventResource, EventType, serverClient, + (void **)&pHead, eventResource, EventType, serverClient, DixReadAccess | DixWriteAccess | DixDestroyAccess); if (i == Success && pHead) { @@ -198,13 +198,13 @@ WMFreeClient(pointer data, XID id) } updateEventMask(pHead); } - free((pointer)pEvent); + free((void *)pEvent); return 1; } /*ARGSUSED*/ static int -WMFreeEvents(pointer data, XID id) +WMFreeEvents(void *data, XID id) { WMEventPtr *pHead, pCur, pNext; @@ -212,9 +212,9 @@ WMFreeEvents(pointer data, XID id) for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource(pCur->clientResource, ClientType); - free((pointer)pCur); + free((void *)pCur); } - free((pointer)pHead); + free((void *)pHead); eventMask = 0; return 1; } @@ -229,7 +229,7 @@ ProcAppleWMSelectInput(register ClientPtr client) REQUEST_SIZE_MATCH(xAppleWMSelectInputReq); i = - dixLookupResourceByType((pointer *)&pHead, eventResource, EventType, + dixLookupResourceByType((void **)&pHead, eventResource, EventType, client, DixWriteAccess); if (stuff->mask != 0) { @@ -257,7 +257,7 @@ ProcAppleWMSelectInput(register ClientPtr client) */ clientResource = FakeClientID(client->index); pNewEvent->clientResource = clientResource; - if (!AddResource(clientResource, ClientType, (pointer)pNewEvent)) + if (!AddResource(clientResource, ClientType, (void *)pNewEvent)) return BadAlloc; /* * create a resource to contain a pointer to the list @@ -268,7 +268,7 @@ ProcAppleWMSelectInput(register ClientPtr client) if (i != Success || !pHead) { pHead = (WMEventPtr *)malloc(sizeof(WMEventPtr)); if (!pHead || - !AddResource(eventResource, EventType, (pointer)pHead)) { + !AddResource(eventResource, EventType, (void *)pHead)) { FreeResource(clientResource, RT_NONE); return BadAlloc; } @@ -317,7 +317,7 @@ AppleWMSendEvent(int type, unsigned int mask, int which, int arg) int i; i = - dixLookupResourceByType((pointer *)&pHead, eventResource, EventType, + dixLookupResourceByType((void **)&pHead, eventResource, EventType, serverClient, DixReadAccess); if (i != Success || !pHead) diff --git a/xorg-server/hw/xquartz/quartzCommon.h b/xorg-server/hw/xquartz/quartzCommon.h index 813bc7713..308a3f173 100644 --- a/xorg-server/hw/xquartz/quartzCommon.h +++ b/xorg-server/hw/xquartz/quartzCommon.h @@ -47,8 +47,8 @@ extern int aquaMenuBarHeight; extern const char *quartzOpenGLBundle; void -QuartzBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask); +QuartzBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask); void -QuartzWakeupHandler(pointer blockData, int result, pointer pReadmask); +QuartzWakeupHandler(void *blockData, int result, void *pReadmask); #endif /* _QUARTZCOMMON_H */ diff --git a/xorg-server/hw/xquartz/xpr/dri.c b/xorg-server/hw/xquartz/xpr/dri.c index adba69cca..014709b04 100644 --- a/xorg-server/hw/xquartz/xpr/dri.c +++ b/xorg-server/hw/xquartz/xpr/dri.c @@ -455,7 +455,7 @@ DRICreateSurface(ScreenPtr pScreen, Drawable id, pDRIDrawablePriv->sid), pDRIDrawablePriv); /* track this in case this window is destroyed */ - AddResource(id, DRIDrawablePrivResType, (pointer)pDrawable); + AddResource(id, DRIDrawablePrivResType, (void *)pDrawable); /* Initialize shape */ DRIUpdateSurface(pDRIDrawablePriv, pDrawable); @@ -529,7 +529,7 @@ DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, * drops to <= 0, or the window/pixmap is destroyed. */ Bool -DRIDrawablePrivDelete(pointer pResource, XID id) +DRIDrawablePrivDelete(void *pResource, XID id) { DrawablePtr pDrawable = (DrawablePtr)pResource; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen); @@ -829,7 +829,7 @@ DRICreatePixmap(ScreenPtr pScreen, Drawable id, dixSetPrivate(&pPix->devPrivates, DRIPixmapBufferPrivKey, shared); - AddResource(id, DRIDrawablePrivResType, (pointer)pDrawable); + AddResource(id, DRIDrawablePrivResType, (void *)pDrawable); return TRUE; } @@ -884,7 +884,7 @@ DRIFreePixmapImp(DrawablePtr pDrawable) shm_unlink(shared->shmPath); free(shared); - dixSetPrivate(&pPix->devPrivates, DRIPixmapBufferPrivKey, (pointer)NULL); + dixSetPrivate(&pPix->devPrivates, DRIPixmapBufferPrivKey, (void *)NULL); return TRUE; } diff --git a/xorg-server/hw/xquartz/xpr/dri.h b/xorg-server/hw/xquartz/xpr/dri.h index 8717a5186..70cb8b6d6 100644 --- a/xorg-server/hw/xquartz/xpr/dri.h +++ b/xorg-server/hw/xquartz/xpr/dri.h @@ -99,7 +99,7 @@ DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, void *data), void *notify_data); extern Bool -DRIDrawablePrivDelete(pointer pResource, XID id); +DRIDrawablePrivDelete(void *pResource, XID id); extern DRIWrappedFuncsRec * DRIGetWrappedFuncs(ScreenPtr pScreen); diff --git a/xorg-server/hw/xquartz/xpr/driWrap.c b/xorg-server/hw/xquartz/xpr/driWrap.c index 5f9f3abd3..42282d52b 100644 --- a/xorg-server/hw/xquartz/xpr/driWrap.c +++ b/xorg-server/hw/xquartz/xpr/driWrap.c @@ -447,7 +447,7 @@ DRIImageText16(DrawablePtr dst, GCPtr pGC, static void DRIImageGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyphInit, - CharInfoPtr *ppciInit, pointer unused) + CharInfoPtr *ppciInit, void *unused) { DRISavedDrawableState saved; @@ -465,7 +465,7 @@ DRIImageGlyphBlt(DrawablePtr dst, GCPtr pGC, static void DRIPolyGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase) + CharInfoPtr *ppci, void *pglyphBase) { DRISavedDrawableState saved; diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index 495e366ca..32d227b31 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -886,7 +886,7 @@ glxWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) GLWIN_TRACE_MSG("glxWinCopyWindow pWindow %p", pWindow); - dixLookupResourceByType((pointer) &pGlxDraw, pWindow->drawable.id, + dixLookupResourceByType((void *) &pGlxDraw, pWindow->drawable.id, __glXDrawableRes, NullClient, DixUnknownAccess); /* diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h index 1d3448a44..63a92f5e3 100644 --- a/xorg-server/hw/xwin/win.h +++ b/xorg-server/hw/xwin/win.h @@ -574,7 +574,7 @@ typedef struct { #endif typedef struct { - pointer value; + void *value; XID id; } WindowIDPairRec, *WindowIDPairPtr; @@ -738,7 +738,7 @@ void winSetAuthorization(void); void winBlockHandler(ScreenPtr pScreen, - pointer pTimeout, pointer pReadMask); + void *pTimeout, void *pReadMask); #ifdef XWIN_NATIVEGDI /* @@ -1003,7 +1003,7 @@ winModifyPixmapHeaderNativeGDI(PixmapPtr pPixmap, int iWidth, int iHeight, int iDepth, int iBitsPerPixel, - int devKind, pointer pPixData); + int devKind, void *pPixData); #endif #ifdef XWIN_NATIVEGDI @@ -1074,7 +1074,7 @@ Bool void winWakeupHandler(ScreenPtr pScreen, - unsigned long ulResult, pointer pReadmask); + unsigned long ulResult, void *pReadmask); /* * winwindow.c diff --git a/xorg-server/hw/xwin/winblock.c b/xorg-server/hw/xwin/winblock.c index c3ef4becd..07e907828 100644 --- a/xorg-server/hw/xwin/winblock.c +++ b/xorg-server/hw/xwin/winblock.c @@ -37,7 +37,7 @@ /* See Porting Layer Definition - p. 6 */ void winBlockHandler(ScreenPtr pScreen, - pointer pTimeout, pointer pReadMask) + void *pTimeout, void *pReadMask) { #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) winScreenPriv(pScreen); diff --git a/xorg-server/hw/xwin/wincmap.c b/xorg-server/hw/xwin/wincmap.c index 283372a9f..4275265be 100644 --- a/xorg-server/hw/xwin/wincmap.c +++ b/xorg-server/hw/xwin/wincmap.c @@ -170,7 +170,7 @@ winUninstallColormap(ColormapPtr pmap) /* Install the default cmap in place of the cmap to be uninstalled */ if (pmap->mid != pmap->pScreen->defColormap) { - dixLookupResourceByType((pointer) &curpmap, pmap->pScreen->defColormap, + dixLookupResourceByType((void *) &curpmap, pmap->pScreen->defColormap, RT_COLORMAP, NullClient, DixUnknownAccess); (*pmap->pScreen->InstallColormap) (curpmap); } diff --git a/xorg-server/hw/xwin/winconfig.c b/xorg-server/hw/xwin/winconfig.c index 11717a506..95b95bc73 100644 --- a/xorg-server/hw/xwin/winconfig.c +++ b/xorg-server/hw/xwin/winconfig.c @@ -106,7 +106,7 @@ winInfoRec g_winInfo = { #ifdef XWIN_XF86CONFIG serverLayoutRec g_winConfigLayout; -static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p); +static Bool ParseOptionValue(int scrnIndex, void *options, OptionInfoPtr p); static Bool configLayout(serverLayoutPtr, XF86ConfLayoutPtr, char *); static Bool configImpliedLayout(serverLayoutPtr, XF86ConfScreenPtr); static Bool GetBoolValue(OptionInfoPtr p, const char *s); @@ -187,7 +187,7 @@ winReadConfigfile() /* Check if layout is given in the config file */ if (g_xf86configptr->conf_flags != NULL) { char *dfltlayout = NULL; - pointer optlist = g_xf86configptr->conf_flags->flg_option_lst; + void *optlist = g_xf86configptr->conf_flags->flg_option_lst; if (optlist && winFindOption(optlist, "defaultserverlayout")) dfltlayout = @@ -591,7 +591,7 @@ winConfigScreens(void) #ifdef XWIN_XF86CONFIG char * -winSetStrOption(pointer optlist, const char *name, char *deflt) +winSetStrOption(void *optlist, const char *name, char *deflt) { OptionInfoRec o; @@ -606,7 +606,7 @@ winSetStrOption(pointer optlist, const char *name, char *deflt) } int -winSetBoolOption(pointer optlist, const char *name, int deflt) +winSetBoolOption(void *optlist, const char *name, int deflt) { OptionInfoRec o; @@ -618,7 +618,7 @@ winSetBoolOption(pointer optlist, const char *name, int deflt) } int -winSetIntOption(pointer optlist, const char *name, int deflt) +winSetIntOption(void *optlist, const char *name, int deflt) { OptionInfoRec o; @@ -630,7 +630,7 @@ winSetIntOption(pointer optlist, const char *name, int deflt) } double -winSetRealOption(pointer optlist, const char *name, double deflt) +winSetRealOption(void *optlist, const char *name, double deflt) { OptionInfoRec o; @@ -642,7 +642,7 @@ winSetRealOption(pointer optlist, const char *name, double deflt) } double -winSetPercentOption(pointer optlist, const char *name, double deflt) +winSetPercentOption(void *optlist, const char *name, double deflt) { OptionInfoRec o; @@ -737,7 +737,7 @@ winFindOptionValue(XF86OptionPtr list, const char *name) */ static Bool -ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p) +ParseOptionValue(int scrnIndex, void *options, OptionInfoPtr p) { char *s, *end; diff --git a/xorg-server/hw/xwin/winconfig.h b/xorg-server/hw/xwin/winconfig.h index 94571ff71..798c779a6 100644 --- a/xorg-server/hw/xwin/winconfig.h +++ b/xorg-server/hw/xwin/winconfig.h @@ -58,15 +58,15 @@ typedef struct { Bool inUse; int videoRam; int textClockFreq; - pointer options; + void *options; int screen; /* For multi-CRTC cards */ } GDevRec, *GDevPtr; typedef struct { char *identifier; char *driver; - pointer commonOptions; - pointer extraOptions; + void *commonOptions; + void *extraOptions; } IDevRec, *IDevPtr; typedef struct { @@ -81,19 +81,19 @@ typedef struct { rgb whiteColour; int defaultVisual; char **modes; - pointer options; + void *options; } DispRec, *DispPtr; typedef struct _confxvportrec { char *identifier; - pointer options; + void *options; } confXvPortRec, *confXvPortPtr; typedef struct _confxvadaptrec { char *identifier; int numports; confXvPortPtr ports; - pointer options; + void *options; } confXvAdaptorRec, *confXvAdaptorPtr; typedef struct _confscreenrec { @@ -107,7 +107,7 @@ typedef struct _confscreenrec { DispPtr displays; int numxvadaptors; confXvAdaptorPtr xvadaptors; - pointer options; + void *options; } confScreenRec, *confScreenPtr; typedef enum { @@ -142,7 +142,7 @@ typedef struct _serverlayoutrec { screenLayoutPtr screens; GDevPtr inactives; IDevPtr inputs; - pointer options; + void *options; } serverLayoutRec, *serverLayoutPtr; /* @@ -233,11 +233,11 @@ typedef struct { * Function prototypes */ -char *winSetStrOption(pointer optlist, const char *name, char *deflt); -int winSetBoolOption(pointer optlist, const char *name, int deflt); -int winSetIntOption(pointer optlist, const char *name, int deflt); -double winSetRealOption(pointer optlist, const char *name, double deflt); -double winSetPercentOption(pointer optlist, const char *name, double deflt); +char *winSetStrOption(void *optlist, const char *name, char *deflt); +int winSetBoolOption(void *optlist, const char *name, int deflt); +int winSetIntOption(void *optlist, const char *name, int deflt); +double winSetRealOption(void *optlist, const char *name, double deflt); +double winSetPercentOption(void *optlist, const char *name, double deflt); #ifdef XWIN_XF86CONFIG XF86OptionPtr winFindOption(XF86OptionPtr list, const char *name); diff --git a/xorg-server/hw/xwin/wingc.c b/xorg-server/hw/xwin/wingc.c index aba398d0a..aba398d0a 100644..100755 --- a/xorg-server/hw/xwin/wingc.c +++ b/xorg-server/hw/xwin/wingc.c diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c index 54e1847d7..e74672529 100644 --- a/xorg-server/hw/xwin/winkeybd.c +++ b/xorg-server/hw/xwin/winkeybd.c @@ -51,7 +51,7 @@ static Bool g_winKeyState[NUM_KEYCODES]; */ static void - winKeybdBell(int iPercent, DeviceIntPtr pDeviceInt, pointer pCtrl, int iClass); + winKeybdBell(int iPercent, DeviceIntPtr pDeviceInt, void *pCtrl, int iClass); static void winKeybdCtrl(DeviceIntPtr pDevice, KeybdCtrl * pCtrl); @@ -120,7 +120,7 @@ winTranslateKey(WPARAM wParam, LPARAM lParam) /* Ring the keyboard bell (system speaker on PCs) */ static void -winKeybdBell(int iPercent, DeviceIntPtr pDeviceInt, pointer pCtrl, int iClass) +winKeybdBell(int iPercent, DeviceIntPtr pDeviceInt, void *pCtrl, int iClass) { /* * We can't use Beep () here because it uses the PC speaker diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c index 94956863b..2439ddb67 100644 --- a/xorg-server/hw/xwin/winmultiwindowwindow.c +++ b/xorg-server/hw/xwin/winmultiwindowwindow.c @@ -53,7 +53,7 @@ static void winUpdateWindowsWindow(WindowPtr pWin); static void - winFindWindow(pointer value, XID id, pointer cdata); + winFindWindow(void *value, XID id, void *cdata); static void @@ -728,7 +728,7 @@ winGetWindowID(WindowPtr pWin) */ static void -winFindWindow(pointer value, XID id, pointer cdata) +winFindWindow(void *value, XID id, void *cdata) { WindowIDPairPtr wi = (WindowIDPairPtr) cdata; @@ -811,7 +811,7 @@ winMinimizeWindow(Window id) winDebug("winMinimizeWindow\n"); - dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient, + dixLookupResourceByType((void *) &pWin, id, RT_WINDOW, NullClient, DixUnknownAccess); if (!pWin) { ErrorF("%s: NULL pWin. Leaving\n", __FUNCTION__); diff --git a/xorg-server/hw/xwin/winpfbdd.c b/xorg-server/hw/xwin/winpfbdd.c index 12f3b172f..976eba9ad 100644 --- a/xorg-server/hw/xwin/winpfbdd.c +++ b/xorg-server/hw/xwin/winpfbdd.c @@ -306,7 +306,7 @@ winCloseScreenPrimaryDD(ScreenPtr pScreen) pScreenInfo->pScreen = NULL; /* Free the screen privates for this screen */ - free((pointer) pScreenPriv); + free((void *) pScreenPriv); return fReturn; } diff --git a/xorg-server/hw/xwin/winpixmap.c b/xorg-server/hw/xwin/winpixmap.c index 43c0c3c14..763d60e8c 100644 --- a/xorg-server/hw/xwin/winpixmap.c +++ b/xorg-server/hw/xwin/winpixmap.c @@ -170,7 +170,7 @@ Bool winModifyPixmapHeaderNativeGDI(PixmapPtr pPixmap, int iWidth, int iHeight, int iDepth, - int iBitsPerPixel, int devKind, pointer pPixData) + int iBitsPerPixel, int devKind, void *pPixData) { FatalError("winModifyPixmapHeaderNativeGDI ()\n"); return TRUE; diff --git a/xorg-server/hw/xwin/winshaddd.c b/xorg-server/hw/xwin/winshaddd.c index 5a117aace..59415515f 100644 --- a/xorg-server/hw/xwin/winshaddd.c +++ b/xorg-server/hw/xwin/winshaddd.c @@ -655,7 +655,7 @@ winCloseScreenShadowDD(ScreenPtr pScreen) pScreenInfo->pScreen = NULL; /* Free the screen privates for this screen */ - free((pointer) pScreenPriv); + free((void *) pScreenPriv); return fReturn; } diff --git a/xorg-server/hw/xwin/winshadddnl.c b/xorg-server/hw/xwin/winshadddnl.c index af13aba52..1ac1af06b 100644 --- a/xorg-server/hw/xwin/winshadddnl.c +++ b/xorg-server/hw/xwin/winshadddnl.c @@ -746,7 +746,7 @@ winCloseScreenShadowDDNL(ScreenPtr pScreen) pScreenInfo->pScreen = NULL; /* Free the screen privates for this screen */ - free((pointer) pScreenPriv); + free((void *) pScreenPriv); return fReturn; } diff --git a/xorg-server/hw/xwin/winshadgdi.c b/xorg-server/hw/xwin/winshadgdi.c index 9e981cea7..d2a357f8e 100644 --- a/xorg-server/hw/xwin/winshadgdi.c +++ b/xorg-server/hw/xwin/winshadgdi.c @@ -613,7 +613,7 @@ winCloseScreenShadowGDI(ScreenPtr pScreen) pScreenInfo->pScreen = NULL; /* Free the screen privates for this screen */ - free((pointer) pScreenPriv); + free((void *) pScreenPriv); return fReturn; } diff --git a/xorg-server/hw/xwin/winwakeup.c b/xorg-server/hw/xwin/winwakeup.c index 795221a1a..ebcb0fad9 100644 --- a/xorg-server/hw/xwin/winwakeup.c +++ b/xorg-server/hw/xwin/winwakeup.c @@ -39,7 +39,7 @@ /* See Porting Layer Definition - p. 7 */ void winWakeupHandler(ScreenPtr pScreen, - unsigned long ulResult, pointer pReadmask) + unsigned long ulResult, void *pReadmask) { MSG msg; diff --git a/xorg-server/hw/xwin/winwindow.c b/xorg-server/hw/xwin/winwindow.c index e3bac41d9..c67a1a610 100644 --- a/xorg-server/hw/xwin/winwindow.c +++ b/xorg-server/hw/xwin/winwindow.c @@ -39,7 +39,7 @@ */ static int - winAddRgn(WindowPtr pWindow, pointer data); + winAddRgn(WindowPtr pWindow, void *data); static void @@ -417,7 +417,7 @@ winSetShapeRootless(WindowPtr pWin, int kind) static int -winAddRgn(WindowPtr pWin, pointer data) +winAddRgn(WindowPtr pWin, void *data) { int iX, iY, iWidth, iHeight, iBorder; HRGN hRgn = *(HRGN *) data; diff --git a/xorg-server/hw/xwin/winwindowswm.c b/xorg-server/hw/xwin/winwindowswm.c index 36f4ce0ae..c61f5b79e 100644..100755 --- a/xorg-server/hw/xwin/winwindowswm.c +++ b/xorg-server/hw/xwin/winwindowswm.c @@ -53,8 +53,8 @@ static XID eventResource; /* Currently selected events */ static unsigned int eventMask = 0; -static int WMFreeClient(pointer data, XID id); -static int WMFreeEvents(pointer data, XID id); +static int WMFreeClient(void *data, XID id); +static int WMFreeEvents(void *data, XID id); static void SNotifyEvent(xWindowsWMNotifyEvent * from, xWindowsWMNotifyEvent * to); @@ -99,13 +99,13 @@ updateEventMask(WMEventPtr * pHead) } /*ARGSUSED*/ static int -WMFreeClient(pointer data, XID id) +WMFreeClient(void *data, XID id) { WMEventPtr pEvent; WMEventPtr *pHead, pCur, pPrev; pEvent = (WMEventPtr) data; - dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType, + dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType, NullClient, DixUnknownAccess); if (pHead) { pPrev = 0; @@ -119,12 +119,12 @@ WMFreeClient(pointer data, XID id) } updateEventMask(pHead); } - free((pointer) pEvent); + free((void *) pEvent); return 1; } /*ARGSUSED*/ static int -WMFreeEvents(pointer data, XID id) +WMFreeEvents(void *data, XID id) { WMEventPtr *pHead, pCur, pNext; @@ -132,9 +132,9 @@ WMFreeEvents(pointer data, XID id) for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource(pCur->clientResource, ClientType); - free((pointer) pCur); + free((void *) pCur); } - free((pointer) pHead); + free((void *) pHead); eventMask = 0; return 1; } @@ -147,7 +147,7 @@ ProcWindowsWMSelectInput(ClientPtr client) XID clientResource; REQUEST_SIZE_MATCH(xWindowsWMSelectInputReq); - dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType, + dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType, client, DixWriteAccess); if (stuff->mask != 0) { if (pHead) { @@ -174,7 +174,7 @@ ProcWindowsWMSelectInput(ClientPtr client) */ clientResource = FakeClientID(client->index); pNewEvent->clientResource = clientResource; - if (!AddResource(clientResource, ClientType, (pointer) pNewEvent)) + if (!AddResource(clientResource, ClientType, (void *) pNewEvent)) return BadAlloc; /* * create a resource to contain a pointer to the list @@ -185,7 +185,7 @@ ProcWindowsWMSelectInput(ClientPtr client) if (!pHead) { pHead = (WMEventPtr *) malloc(sizeof(WMEventPtr)); if (!pHead || - !AddResource(eventResource, eventResourceType, (pointer) pHead)) + !AddResource(eventResource, eventResourceType, (void *) pHead)) { FreeResource(clientResource, RT_NONE); return BadAlloc; @@ -236,7 +236,7 @@ winWindowsWMSendEvent(int type, unsigned int mask, int which, int arg, xWindowsWMNotifyEvent se; winDebug ("winWindowsWMSendEvent %d %d %d %d, %d %d - %d %d\n", type, mask, which, arg, x, y, w, h); - dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType, + dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType, NullClient, DixUnknownAccess); if (!pHead) return; diff --git a/xorg-server/include/callback.h b/xorg-server/include/callback.h index b4249e8a5..ffdbac270 100644 --- a/xorg-server/include/callback.h +++ b/xorg-server/include/callback.h @@ -66,21 +66,21 @@ typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */ #define _XTYPEDEF_CALLBACKLISTPTR #endif -typedef void (*CallbackProcPtr) (CallbackListPtr *, pointer, pointer); +typedef void (*CallbackProcPtr) (CallbackListPtr *, void *, void *); extern _X_EXPORT Bool AddCallback(CallbackListPtr * /*pcbl */ , CallbackProcPtr /*callback */ , - pointer /*data */ ); + void */*data */ ); extern _X_EXPORT Bool DeleteCallback(CallbackListPtr * /*pcbl */ , CallbackProcPtr /*callback */ , - pointer /*data */ ); + void */*data */ ); extern _X_EXPORT void _CallCallbacks(CallbackListPtr * /*pcbl */ , - pointer /*call_data */ ); + void */*call_data */ ); static inline void -CallCallbacks(CallbackListPtr *pcbl, pointer call_data) +CallCallbacks(CallbackListPtr *pcbl, void *call_data) { if (!pcbl || !*pcbl) return; diff --git a/xorg-server/include/closestr.h b/xorg-server/include/closestr.h index 9715b7cfb..87a2f1781 100644 --- a/xorg-server/include/closestr.h +++ b/xorg-server/include/closestr.h @@ -47,7 +47,7 @@ typedef struct _OFclosure { Mask flags; /* XXX -- get these from request buffer instead? */ - char *origFontName; + const char *origFontName; int origFontNameLen; XID fontid; char *fontname; @@ -65,7 +65,7 @@ typedef struct _LFWIstate { int current_fpe; int max_names; Bool list_started; - pointer private; + void *private; } LFWIstateRec, *LFWIstatePtr; typedef struct _LFWIclosure { diff --git a/xorg-server/include/colormap.h b/xorg-server/include/colormap.h index 8996cfec5..22229ca84 100644 --- a/xorg-server/include/colormap.h +++ b/xorg-server/include/colormap.h @@ -82,14 +82,14 @@ extern _X_EXPORT int CreateColormap(Colormap /*mid */ , int /*alloc */ , int /*client */ ); -extern _X_EXPORT int FreeColormap(pointer /*pmap */ , +extern _X_EXPORT int FreeColormap(void */*pmap */ , XID /*mid */ ); extern _X_EXPORT int TellLostMap(WindowPtr /*pwin */ , - pointer /* Colormap *pmid */ ); + void */* Colormap *pmid */ ); extern _X_EXPORT int TellGainedMap(WindowPtr /*pwin */ , - pointer /* Colormap *pmid */ ); + void */* Colormap *pmid */ ); extern _X_EXPORT int CopyColormapAndFree(Colormap /*mid */ , ColormapPtr /*pSrc */ , @@ -126,7 +126,7 @@ extern _X_EXPORT int QueryColors(ColormapPtr /*pmap */ , xrgb * /*prgbList */ , ClientPtr client); -extern _X_EXPORT int FreeClientPixels(pointer /*pcr */ , +extern _X_EXPORT int FreeClientPixels(void */*pcr */ , XID /*fakeid */ ); extern _X_EXPORT int AllocColorCells(int /*client */ , diff --git a/xorg-server/include/cursor.h b/xorg-server/include/cursor.h index 89a650fc5..9da08affd 100644 --- a/xorg-server/include/cursor.h +++ b/xorg-server/include/cursor.h @@ -68,7 +68,7 @@ extern _X_EXPORT DevScreenPrivateKeyRec cursorScreenDevPriv; extern _X_EXPORT CursorPtr rootCursor; -extern _X_EXPORT int FreeCursor(pointer /*pCurs */ , +extern _X_EXPORT int FreeCursor(void */*pCurs */ , XID /*cid */ ); extern _X_EXPORT CursorPtr RefCursor(CursorPtr /* cursor */); diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in index 306610000..957257b12 100644 --- a/xorg-server/include/dix-config.h.in +++ b/xorg-server/include/dix-config.h.in @@ -469,4 +469,7 @@ /* Directory for shared memory temp files */ #undef SHMDIR +/* Don't let Xdefs.h define 'pointer' */ +#define _XTYPEDEF_POINTER 1 + #endif /* _DIX_CONFIG_H_ */ diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h index fa7ccd4a3..8371df072 100644 --- a/xorg-server/include/dix.h +++ b/xorg-server/include/dix.h @@ -147,14 +147,14 @@ extern _X_EXPORT void UpdateCurrentTime(void); extern _X_EXPORT void UpdateCurrentTimeIf(void); -extern _X_EXPORT int dixDestroyPixmap(pointer /*value */ , +extern _X_EXPORT int dixDestroyPixmap(void */*value */ , XID /*pid */ ); extern _X_EXPORT void InitClient(ClientPtr /*client */ , int /*i */ , - pointer /*ospriv */ ); + void */*ospriv */ ); -extern _X_EXPORT ClientPtr NextAvailableClient(pointer /*ospriv */ ); +extern _X_EXPORT ClientPtr NextAvailableClient(void */*ospriv */ ); extern _X_EXPORT void SendErrorToClient(ClientPtr /*client */ , unsigned int /*majorCode */ , @@ -203,11 +203,11 @@ extern _X_EXPORT int AlterSaveSetForClient(ClientPtr /*client */ , extern _X_EXPORT void DeleteWindowFromAnySaveSet(WindowPtr /*pWin */ ); -extern _X_EXPORT void BlockHandler(pointer /*pTimeout */ , - pointer /*pReadmask */ ); +extern _X_EXPORT void BlockHandler(void */*pTimeout */ , + void */*pReadmask */ ); extern _X_EXPORT void WakeupHandler(int /*result */ , - pointer /*pReadmask */ ); + void */*pReadmask */ ); void EnableLimitedSchedulingLatency(void); @@ -215,21 +215,21 @@ void void DisableLimitedSchedulingLatency(void); -typedef void (*WakeupHandlerProcPtr) (pointer /* blockData */ , +typedef void (*WakeupHandlerProcPtr) (void */* blockData */ , int /* result */ , - pointer /* pReadmask */ ); + void */* pReadmask */ ); extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr /*blockHandler */ , WakeupHandlerProcPtr /*wakeupHandler */ , - pointer /*blockData */ ); + void */*blockData */ ); extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr /*blockHandler */ , WakeupHandlerProcPtr /*wakeupHandler */ , - pointer /*blockData */ ); + void */*blockData */ ); extern _X_EXPORT void InitBlockAndWakeupHandlers(void); @@ -241,18 +241,18 @@ extern _X_EXPORT Bool QueueWorkProc(Bool (* /*function */ )( ClientPtr /*clientUnused */ , - pointer + void * /*closure */ ), ClientPtr /*client */ , - pointer /*closure */ + void */*closure */ ); typedef Bool (*ClientSleepProcPtr) (ClientPtr /*client */ , - pointer /*closure */ ); + void */*closure */ ); extern _X_EXPORT Bool ClientSleep(ClientPtr /*client */ , ClientSleepProcPtr /* function */ , - pointer /*closure */ ); + void */*closure */ ); #ifndef ___CLIENTSIGNAL_DEFINED___ #define ___CLIENTSIGNAL_DEFINED___ @@ -289,7 +289,10 @@ extern _X_EXPORT void SetVendorRelease(int release); extern _X_EXPORT void -SetVendorString(char *string); +SetVendorString(const char *string); + +int +dix_main(int argc, char *argv[], char *envp[]); /* events.c */ @@ -441,7 +444,7 @@ extern void RecalculateDeliverableEvents(WindowPtr /* pWin */ ); extern _X_EXPORT int -OtherClientGone(pointer /* value */ , +OtherClientGone(void */* value */ , XID /* id */ ); extern void diff --git a/xorg-server/include/dixfont.h b/xorg-server/include/dixfont.h index 0a5f105c0..40d80c141 100644 --- a/xorg-server/include/dixfont.h +++ b/xorg-server/include/dixfont.h @@ -34,23 +34,23 @@ SOFTWARE. typedef struct _DIXFontProp *DIXFontPropPtr; -extern _X_EXPORT Bool SetDefaultFont(char * /*defaultfontname */ ); +extern _X_EXPORT Bool SetDefaultFont(const char * /*defaultfontname */ ); extern _X_EXPORT void QueueFontWakeup(FontPathElementPtr /*fpe */ ); extern _X_EXPORT void RemoveFontWakeup(FontPathElementPtr /*fpe */ ); -extern _X_EXPORT void FontWakeup(pointer /*data */ , +extern _X_EXPORT void FontWakeup(void */*data */ , int /*count */ , - pointer /*LastSelectMask */ ); + void */*LastSelectMask */ ); extern _X_EXPORT int OpenFont(ClientPtr /*client */ , XID /*fid */ , Mask /*flags */ , unsigned /*lenfname */ , - char * /*pfontname */ ); + const char * /*pfontname */ ); -extern _X_EXPORT int CloseFont(pointer /*pfont */ , +extern _X_EXPORT int CloseFont(void */*pfont */ , XID /*fid */ ); typedef struct _xQueryFontReply *xQueryFontReplyPtr; @@ -99,7 +99,7 @@ extern _X_EXPORT int SetFontPath(ClientPtr /*client */ , int /*npaths */ , unsigned char * /*paths */ ); -extern _X_EXPORT int SetDefaultFontPath(char * /*path */ ); +extern _X_EXPORT int SetDefaultFontPath(const char * /*path */ ); extern _X_EXPORT int GetFontPath(ClientPtr client, int *count, diff --git a/xorg-server/include/dixgrabs.h b/xorg-server/include/dixgrabs.h index ca3c95be7..d78d8127b 100644 --- a/xorg-server/include/dixgrabs.h +++ b/xorg-server/include/dixgrabs.h @@ -47,7 +47,7 @@ extern GrabPtr CreateGrab(int /* client */ , WindowPtr /* confineTo */ , CursorPtr /* cursor */ ); -extern _X_EXPORT int DeletePassiveGrab(pointer /* value */ , +extern _X_EXPORT int DeletePassiveGrab(void */* value */ , XID /* id */ ); extern _X_EXPORT Bool GrabMatchesSecond(GrabPtr /* pFirstGrab */ , diff --git a/xorg-server/include/dixstruct.h b/xorg-server/include/dixstruct.h index 440e5ccdd..7bbd2bd54 100644 --- a/xorg-server/include/dixstruct.h +++ b/xorg-server/include/dixstruct.h @@ -74,8 +74,8 @@ typedef struct _saveSet { #define SaveSetAssignMap(ss,m) ((ss).map = (m)) typedef struct _Client { - pointer requestBuffer; - pointer osPrivate; /* for OS layer, including scheduler */ + void *requestBuffer; + void *osPrivate; /* for OS layer, including scheduler */ Mask clientAsMask; short index; unsigned char majorOp, minorOp; @@ -149,10 +149,10 @@ SmartScheduleInit(void); typedef struct _WorkQueue { struct _WorkQueue *next; Bool (*function) (ClientPtr /* pClient */ , - pointer /* closure */ + void * /* closure */ ); ClientPtr client; - pointer closure; + void *closure; } WorkQueueRec; extern _X_EXPORT TimeStamp currentTime; @@ -166,7 +166,7 @@ ClientTimeToServerTime(CARD32 /*c */ ); typedef struct _CallbackRec { CallbackProcPtr proc; - pointer data; + void *data; Bool deleted; struct _CallbackRec *next; } CallbackRec, *CallbackPtr; diff --git a/xorg-server/include/extnsionst.h b/xorg-server/include/extnsionst.h index e82523698..fbdb73c53 100644 --- a/xorg-server/include/extnsionst.h +++ b/xorg-server/include/extnsionst.h @@ -58,15 +58,15 @@ typedef struct _ExtensionEntry { int index; void (*CloseDown) ( /* called at server shutdown */ struct _ExtensionEntry * /* extension */ ); - char *name; /* extension name */ + const char *name; /* extension name */ int base; /* base request number */ int eventBase; int eventLast; int errorBase; int errorLast; int num_aliases; - char **aliases; - pointer extPrivate; + const char **aliases; + void *extPrivate; unsigned short (*MinorOpcode) ( /* called for errors */ ClientPtr /* client */ ); PrivateRec *devPrivates; diff --git a/xorg-server/include/gc.h b/xorg-server/include/gc.h index a78d922f2..94e68239e 100644..100755 --- a/xorg-server/include/gc.h +++ b/xorg-server/include/gc.h @@ -87,7 +87,7 @@ extern _X_EXPORT void ValidateGC(DrawablePtr /*pDraw */ , GCPtr /*pGC */ ); typedef union { - pointer ptr; + void *ptr; CARD32 val; } ChangeGCVal, *ChangeGCValPtr; @@ -112,7 +112,7 @@ extern _X_EXPORT int CopyGC(GCPtr /*pgcSrc */ , GCPtr /*pgcDst */ , BITS32 /*mask */ ); -extern _X_EXPORT int FreeGC(pointer /*pGC */ , +extern _X_EXPORT int FreeGC(void */*pGC */ , XID /*gid */ ); extern _X_EXPORT void FreeGCperDepth(int /*screenNum */ ); diff --git a/xorg-server/include/gcstruct.h b/xorg-server/include/gcstruct.h index 7621ceb11..c830ccde7 100644 --- a/xorg-server/include/gcstruct.h +++ b/xorg-server/include/gcstruct.h @@ -78,7 +78,7 @@ typedef struct _GCFuncs { void (*ChangeClip) (GCPtr /*pGC */ , int /*type */ , - pointer /*pvalue */ , + void */*pvalue */ , int /*nrects */ ); void (*DestroyClip) (GCPtr /*pGC */ ); @@ -216,7 +216,7 @@ typedef struct _GCOps { int /*y */ , unsigned int /*nglyph */ , CharInfoPtr * /*ppci */ , - pointer /*pglyphBase */ ); + void */*pglyphBase */ ); void (*PolyGlyphBlt) (DrawablePtr /*pDrawable */ , GCPtr /*pGC */ , @@ -224,7 +224,7 @@ typedef struct _GCOps { int /*y */ , unsigned int /*nglyph */ , CharInfoPtr * /*ppci */ , - pointer /*pglyphBase */ ); + void */*pglyphBase */ ); void (*PushPixels) (GCPtr /*pGC */ , PixmapPtr /*pBitMap */ , @@ -273,11 +273,11 @@ typedef struct _GC { DDXPointRec patOrg; /* origin for (tile, stipple) */ struct _Font *font; DDXPointRec clipOrg; - pointer clientClip; + void *clientClip; unsigned long stateChanges; /* masked with GC_<kind> */ unsigned long serialNumber; - GCFuncs *funcs; - GCOps *ops; + const GCFuncs *funcs; + const GCOps *ops; PrivateRec *devPrivates; /* * The following were moved here from private storage to allow device- diff --git a/xorg-server/include/globals.h b/xorg-server/include/globals.h index 7786987a4..858c9a375 100644 --- a/xorg-server/include/globals.h +++ b/xorg-server/include/globals.h @@ -18,7 +18,7 @@ extern _X_EXPORT CARD32 ScreenSaverInterval; extern _X_EXPORT Bool screenSaverSuspended; #endif -extern _X_EXPORT char *defaultFontPath; +extern _X_EXPORT const char *defaultFontPath; extern _X_EXPORT int monitorResolution; extern _X_EXPORT int defaultColorVisualClass; diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h index b42510d9b..a23ce5c3f 100644 --- a/xorg-server/include/input.h +++ b/xorg-server/include/input.h @@ -163,7 +163,7 @@ typedef Bool (*PointerAccelSchemeInitProc) (DeviceIntPtr /*dev */ , /*protoScheme */ ); typedef struct _DeviceRec { - pointer devicePrivate; + void *devicePrivate; ProcessInputProc processInputProc; /* current */ ProcessInputProc realInputProc; /* deliver */ ProcessInputProc enqueueInputProc; /* enqueue */ @@ -221,12 +221,12 @@ typedef struct _InputOption InputOption; typedef struct _XI2Mask XI2Mask; typedef struct _InputAttributes { - char *product; - char *vendor; - char *device; - char *pnp_id; - char *usb_id; - char **tags; /* null-terminated */ + const char *product; + const char *vendor; + const char *device; + const char *pnp_id; + const char *usb_id; + const char **tags; /* null-terminated */ uint32_t flags; } InputAttributes; @@ -316,7 +316,7 @@ extern _X_EXPORT Bool InitTouchClassDeviceStruct(DeviceIntPtr /*device */ , typedef void (*BellProcPtr) (int /*percent */ , DeviceIntPtr /*device */ , - pointer /*ctrl */ , + void */*ctrl */ , int); typedef void (*KbdCtrlProcPtr) (DeviceIntPtr /*device */ , diff --git a/xorg-server/include/inputstr.h b/xorg-server/include/inputstr.h index dc36c5d8d..dfcf7c383 100644 --- a/xorg-server/include/inputstr.h +++ b/xorg-server/include/inputstr.h @@ -447,7 +447,7 @@ typedef struct _XIPropertyValue { Atom type; /* ignored by server */ short format; /* format of data for swapping - 8,16,32 */ long size; /* size of data in (format/8) bytes */ - pointer data; /* private to client */ + void *data; /* private to client */ } XIPropertyValueRec; typedef struct _XIProperty { @@ -542,7 +542,7 @@ typedef struct _DeviceIntRec { GrabInfoRec deviceGrab; /* grab on the device */ int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */ Atom xinput_type; - char *name; + const char *name; int id; KeyClassPtr key; ValuatorClassPtr valuator; diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h index 19e71035c..660200558 100644 --- a/xorg-server/include/misc.h +++ b/xorg-server/include/misc.h @@ -256,7 +256,7 @@ padding_for_int32(const int bytes) } -extern char **xstrtokenize(const char *str, const char *separators); +extern const char **xstrtokenize(const char *str, const char *separators); extern void FormatInt64(int64_t num, char *string); extern void FormatUInt64(uint64_t num, char *string); extern void FormatUInt64Hex(uint64_t num, char *string); diff --git a/xorg-server/include/miscstruct.h b/xorg-server/include/miscstruct.h index 0820e1e81..dbab10f08 100644 --- a/xorg-server/include/miscstruct.h +++ b/xorg-server/include/miscstruct.h @@ -56,10 +56,10 @@ typedef xPoint DDXPointRec; typedef struct pixman_box16 BoxRec; typedef union _DevUnion { - pointer ptr; + void *ptr; long val; unsigned long uval; - pointer (*fptr) (void); + void *(*fptr) (void); } DevUnion; #endif /* MISCSTRUCT_H */ diff --git a/xorg-server/include/opaque.h b/xorg-server/include/opaque.h index b76ab6e6b..73d40c345 100644 --- a/xorg-server/include/opaque.h +++ b/xorg-server/include/opaque.h @@ -33,8 +33,8 @@ from The Open Group. #include "globals.h" -extern _X_EXPORT char *defaultTextFont; -extern _X_EXPORT char *defaultCursorFont; +extern _X_EXPORT const char *defaultTextFont; +extern _X_EXPORT const char *defaultCursorFont; extern _X_EXPORT int MaxClients; extern _X_EXPORT volatile char isItTimeToYield; extern _X_EXPORT volatile char dispatchException; @@ -49,7 +49,7 @@ extern _X_EXPORT int ScreenSaverBlanking; extern _X_EXPORT int ScreenSaverAllowExposures; extern _X_EXPORT int defaultScreenSaverBlanking; extern _X_EXPORT int defaultScreenSaverAllowExposures; -extern _X_EXPORT char *display; +extern _X_EXPORT const char *display; extern _X_EXPORT int displayfd; extern _X_EXPORT int defaultBackingStore; diff --git a/xorg-server/include/os.h b/xorg-server/include/os.h index 218b7f639..7bdb2fc85 100644 --- a/xorg-server/include/os.h +++ b/xorg-server/include/os.h @@ -70,12 +70,12 @@ typedef struct _NewClientRec *NewClientPtr; #ifndef xalloc #define xnfalloc(size) XNFalloc((unsigned long)(size)) #define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size)) -#define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size)) +#define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size)) #define xalloc(size) Xalloc((unsigned long)(size)) #define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size)) -#define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size)) -#define xfree(ptr) Xfree((pointer)(ptr)) +#define xrealloc(ptr, size) Xrealloc((void *)(ptr), (unsigned long)(size)) +#define xfree(ptr) Xfree((void *)(ptr)) #define xstrdup(s) Xstrdup(s) #define xnfstrdup(s) XNFstrdup(s) #endif @@ -142,7 +142,7 @@ extern _X_EXPORT const char *ClientAuthorized(ClientPtr /*client */ , char * /*auth_string */ ); extern _X_EXPORT Bool EstablishNewConnections(ClientPtr /*clientUnused */ , - pointer /*closure */ ); + void */*closure */ ); extern _X_EXPORT void CheckConnections(void); @@ -175,14 +175,14 @@ extern void ListenOnOpenFD(int /* fd */ , int /* noxauth */ ); extern _X_EXPORT CARD32 GetTimeInMillis(void); extern _X_EXPORT CARD64 GetTimeInMicros(void); -extern _X_EXPORT void AdjustWaitForDelay(pointer /*waitTime */ , +extern _X_EXPORT void AdjustWaitForDelay(void */*waitTime */ , unsigned long /*newdelay */ ); typedef struct _OsTimerRec *OsTimerPtr; typedef CARD32 (*OsTimerCallback) (OsTimerPtr /* timer */ , CARD32 /* time */ , - pointer /* arg */ ); + void */* arg */ ); extern _X_EXPORT void TimerInit(void); @@ -195,7 +195,7 @@ extern _X_EXPORT OsTimerPtr TimerSet(OsTimerPtr /* timer */ , int /* flags */ , CARD32 /* millis */ , OsTimerCallback /* func */ , - pointer /* arg */ ); + void */* arg */ ); extern _X_EXPORT void TimerCheck(void); extern _X_EXPORT void TimerCancel(OsTimerPtr /* pTimer */ ); @@ -214,7 +214,7 @@ extern _X_EXPORT void ProcessCommandLine(int /*argc */ , char * /*argv */ []); extern _X_EXPORT int set_font_authorizations(char ** /* authorizations */ , int * /*authlen */ , - pointer /* client */ ); + void */* client */ ); #ifndef _HAVE_XALLOC_DECLS #define _HAVE_XALLOC_DECLS @@ -361,14 +361,14 @@ OsAbort(void) #if !defined(WIN32) extern _X_EXPORT int System(const char *); -extern _X_EXPORT pointer +extern _X_EXPORT void * Popen(const char *, const char *); extern _X_EXPORT int -Pclose(pointer); -extern _X_EXPORT pointer +Pclose(void *); +extern _X_EXPORT void * Fopen(const char *, const char *); extern _X_EXPORT int -Fclose(pointer); +Fclose(void *); #else extern const char * @@ -397,17 +397,17 @@ ForEachHostInFamily(int /*family */ , Bool (* /*func */ )( unsigned char * /* addr */ , short /* len */ , - pointer /* closure */ ), - pointer /*closure */ ); + void */* closure */ ), + void */*closure */ ); extern _X_EXPORT int RemoveHost(ClientPtr /*client */ , int /*family */ , unsigned /*length */ , - pointer /*pAddr */ ); + void */*pAddr */ ); extern _X_EXPORT int -GetHosts(pointer * /*data */ , +GetHosts(void ** /*data */ , int * /*pnHosts */ , int * /*pLen */ , BOOL * /*pEnabled */ ); @@ -450,7 +450,7 @@ extern _X_EXPORT void AddLocalHosts(void); extern _X_EXPORT void -ResetHosts(char *display); +ResetHosts(const char *display); extern _X_EXPORT void EnableLocalHost(void); @@ -466,14 +466,14 @@ DefineSelf(int /*fd */ , const int /*protocol*/); #if XDMCP extern _X_EXPORT void -AugmentSelf(pointer /*from */ , int /*len */ ); +AugmentSelf(void */*from */ , int /*len */ ); extern _X_EXPORT void RegisterAuthorizations(void); #endif extern _X_EXPORT void -InitAuthorization(char * /*filename */ ); +InitAuthorization(const char * /*filename */ ); /* extern int LoadAuthorization(void); */ diff --git a/xorg-server/include/pixmap.h b/xorg-server/include/pixmap.h index 921a94d1e..46ec3f5a2 100644 --- a/xorg-server/include/pixmap.h +++ b/xorg-server/include/pixmap.h @@ -99,7 +99,7 @@ extern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr /*pScreen */ , int /*depth */ , int /*bitsPerPixel */ , int /*devKind */ , - pointer /*pPixData */ ); + void */*pPixData */ ); extern _X_EXPORT void FreeScratchPixmapHeader(PixmapPtr /*pPixmap */ ); diff --git a/xorg-server/include/privates.h b/xorg-server/include/privates.h index 0abdce784..7d1461cdb 100644 --- a/xorg-server/include/privates.h +++ b/xorg-server/include/privates.h @@ -142,10 +142,10 @@ dixGetPrivate(PrivatePtr *privates, const DevPrivateKey key) * dixLookupPrivate(privates, key) will return 'val'. */ static inline void -dixSetPrivate(PrivatePtr *privates, const DevPrivateKey key, pointer val) +dixSetPrivate(PrivatePtr *privates, const DevPrivateKey key, void *val) { assert(key->size == 0); - *(pointer *) dixGetPrivateAddr(privates, key) = val; + *(void **) dixGetPrivateAddr(privates, key) = val; } #include "dix.h" @@ -158,7 +158,7 @@ dixSetPrivate(PrivatePtr *privates, const DevPrivateKey key, pointer val) * storage. For privates without defined storage, return the pointer * contents */ -static inline pointer +static inline void * dixLookupPrivate(PrivatePtr *privates, const DevPrivateKey key) { if (key->size) @@ -173,11 +173,11 @@ dixLookupPrivate(PrivatePtr *privates, const DevPrivateKey key) * This returns the place where the private pointer is stored, * which is only valid for privates without predefined storage. */ -static inline pointer * +static inline void ** dixLookupPrivateAddr(PrivatePtr *privates, const DevPrivateKey key) { assert(key->size == 0); - return (pointer *) dixGetPrivateAddr(privates, key); + return (void **) dixGetPrivateAddr(privates, key); } extern _X_EXPORT Bool @@ -204,19 +204,19 @@ dixGetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, static inline void dixSetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, - ScreenPtr pScreen, pointer val) + ScreenPtr pScreen, void *val) { dixSetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen), val); } -static inline pointer +static inline void * dixLookupScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) { return dixLookupPrivate(privates, _dixGetScreenPrivateKey(key, pScreen)); } -static inline pointer * +static inline void ** dixLookupScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKey key, ScreenPtr pScreen) { diff --git a/xorg-server/include/property.h b/xorg-server/include/property.h index 4219fc487..3b8ea8b2d 100644 --- a/xorg-server/include/property.h +++ b/xorg-server/include/property.h @@ -64,7 +64,7 @@ extern _X_EXPORT int dixChangeWindowProperty(ClientPtr /*pClient */ , int /*format */ , int /*mode */ , unsigned long /*len */ , - pointer /*value */ , + void */*value */ , Bool /*sendevent */ ); extern _X_EXPORT int ChangeWindowProperty(WindowPtr /*pWin */ , @@ -73,7 +73,7 @@ extern _X_EXPORT int ChangeWindowProperty(WindowPtr /*pWin */ , int /*format */ , int /*mode */ , unsigned long /*len */ , - pointer /*value */ , + void */*value */ , Bool /*sendevent */ ); extern _X_EXPORT int DeleteProperty(ClientPtr /*client */ , diff --git a/xorg-server/include/propertyst.h b/xorg-server/include/propertyst.h index c12c71af6..da995769c 100644 --- a/xorg-server/include/propertyst.h +++ b/xorg-server/include/propertyst.h @@ -59,7 +59,7 @@ typedef struct _Property { ATOM type; /* ignored by server */ uint32_t format; /* format of data for swapping - 8,16,32 */ uint32_t size; /* size of data in (format/8) bytes */ - pointer data; /* private to client */ + void *data; /* private to client */ PrivateRec *devPrivates; } PropertyRec; diff --git a/xorg-server/include/resource.h b/xorg-server/include/resource.h index 3719242bf..7c9bf43df 100644 --- a/xorg-server/include/resource.h +++ b/xorg-server/include/resource.h @@ -136,24 +136,24 @@ typedef struct { ResourceState state; XID id; RESTYPE type; - pointer value; + void *value; } ResourceStateInfoRec; -typedef int (*DeleteType) (pointer /*value */ , +typedef int (*DeleteType) (void */*value */ , XID /*id */ ); -typedef void (*FindResType) (pointer /*value */ , +typedef void (*FindResType) (void */*value */ , XID /*id */ , - pointer /*cdata */ ); + void */*cdata */ ); -typedef void (*FindAllRes) (pointer /*value */ , +typedef void (*FindAllRes) (void */*value */ , XID /*id */ , RESTYPE /*type */ , - pointer /*cdata */ ); + void */*cdata */ ); -typedef Bool (*FindComplexResType) (pointer /*value */ , +typedef Bool (*FindComplexResType) (void */*value */ , XID /*id */ , - pointer /*cdata */ ); + void */*cdata */ ); /* Structure for estimating resource memory usage. Memory usage * consists of space allocated for the resource itself and of @@ -169,16 +169,16 @@ typedef struct { unsigned long refCnt; } ResourceSizeRec, *ResourceSizePtr; -typedef void (*SizeType)(pointer /*value*/, +typedef void (*SizeType)(void */*value*/, XID /*id*/, ResourceSizePtr /*size*/); extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType /*deleteFunc */ , const char * /*name */ ); -typedef void (*FindTypeSubResources)(pointer /* value */, +typedef void (*FindTypeSubResources)(void */* value */, FindAllRes /* func */, - pointer /* cdata */); + void */* cdata */); extern _X_EXPORT SizeType GetResourceTypeSizeFunc( RESTYPE /*type*/); @@ -205,7 +205,7 @@ extern _X_EXPORT XID FakeClientID(int /*client */ ); #endif extern _X_EXPORT Bool AddResource(XID /*id */ , RESTYPE /*type */ , - pointer /*value */ ); + void */*value */ ); extern _X_EXPORT void FreeResource(XID /*id */ , RESTYPE /*skipDeleteFuncType */ ); @@ -216,25 +216,25 @@ extern _X_EXPORT void FreeResourceByType(XID /*id */ , extern _X_EXPORT Bool ChangeResourceValue(XID /*id */ , RESTYPE /*rtype */ , - pointer /*value */ ); + void */*value */ ); extern _X_EXPORT void FindClientResourcesByType(ClientPtr /*client */ , RESTYPE /*type */ , FindResType /*func */ , - pointer /*cdata */ ); + void */*cdata */ ); extern _X_EXPORT void FindAllClientResources(ClientPtr /*client */ , FindAllRes /*func */ , - pointer /*cdata */ ); + void */*cdata */ ); /** @brief Iterate through all subresources of a resource. @note The XID argument provided to the FindAllRes function may be 0 for subresources that don't have an XID */ -extern _X_EXPORT void FindSubResources(pointer /*resource*/, +extern _X_EXPORT void FindSubResources(void */*resource*/, RESTYPE /*type*/, FindAllRes /*func*/, - pointer /*cdata*/); + void */*cdata*/); extern _X_EXPORT void FreeClientNeverRetainResources(ClientPtr /*client */ ); @@ -245,18 +245,18 @@ extern _X_EXPORT void FreeAllResources(void); extern _X_EXPORT Bool LegalNewID(XID /*id */ , ClientPtr /*client */ ); -extern _X_EXPORT pointer LookupClientResourceComplex(ClientPtr client, +extern _X_EXPORT void *LookupClientResourceComplex(ClientPtr client, RESTYPE type, FindComplexResType func, - pointer cdata); + void *cdata); -extern _X_EXPORT int dixLookupResourceByType(pointer *result, +extern _X_EXPORT int dixLookupResourceByType(void **result, XID id, RESTYPE rtype, ClientPtr client, Mask access_mode); -extern _X_EXPORT int dixLookupResourceByClass(pointer *result, +extern _X_EXPORT int dixLookupResourceByClass(void **result, XID id, RESTYPE rclass, ClientPtr client, diff --git a/xorg-server/include/scrnintstr.h b/xorg-server/include/scrnintstr.h index 6afda0322..3dc499e7f 100644 --- a/xorg-server/include/scrnintstr.h +++ b/xorg-server/include/scrnintstr.h @@ -260,12 +260,12 @@ typedef void (*SendGraphicsExposeProcPtr) (ClientPtr /*client */ , int /*minor */ ); typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr /*pScreen*/ , - pointer /*pTimeout */ , - pointer /*pReadmask */ ); + void */*pTimeout */ , + void */*pReadmask */ ); typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr /*pScreen*/ , unsigned long /*result */ , - pointer /*pReadMask */ ); + void */*pReadMask */ ); typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ ); @@ -275,7 +275,7 @@ typedef Bool (*ModifyPixmapHeaderProcPtr) (PixmapPtr /*pPixmap */ , int /*depth */ , int /*bitsPerPixel */ , int /*devKind */ , - pointer /*pPixData */ ); + void */*pPixData */ ); typedef PixmapPtr (*GetWindowPixmapProcPtr) (WindowPtr /*pWin */ ); @@ -379,7 +379,7 @@ typedef struct _Screen { a standard one. */ PixmapPtr PixmapPerDepth[1]; - pointer devPrivate; + void *devPrivate; short numVisuals; VisualPtr visuals; WindowPtr root; diff --git a/xorg-server/include/window.h b/xorg-server/include/window.h index b6d61c339..b5a937eef 100644 --- a/xorg-server/include/window.h +++ b/xorg-server/include/window.h @@ -73,15 +73,15 @@ typedef struct _BackingStore *BackingStorePtr; typedef struct _Window *WindowPtr; typedef int (*VisitWindowProcPtr) (WindowPtr /*pWin */ , - pointer /*data */ ); + void */*data */ ); extern _X_EXPORT int TraverseTree(WindowPtr /*pWin */ , VisitWindowProcPtr /*func */ , - pointer /*data */ ); + void */*data */ ); extern _X_EXPORT int WalkTree(ScreenPtr /*pScreen */ , VisitWindowProcPtr /*func */ , - pointer /*data */ ); + void */*data */ ); extern _X_EXPORT Bool CreateRootWindow(ScreenPtr /*pScreen */ ); @@ -108,7 +108,7 @@ extern _X_EXPORT WindowPtr CreateWindow(Window /*wid */ , VisualID /*visual */ , int * /*error */ ); -extern _X_EXPORT int DeleteWindow(pointer /*pWin */ , +extern _X_EXPORT int DeleteWindow(void */*pWin */ , XID /*wid */ ); extern _X_EXPORT int DestroySubwindows(WindowPtr /*pWin */ , diff --git a/xorg-server/include/windowstr.h b/xorg-server/include/windowstr.h index 15a83f056..e06418659 100644 --- a/xorg-server/include/windowstr.h +++ b/xorg-server/include/windowstr.h @@ -144,7 +144,7 @@ typedef struct _Window { Mask eventMask; /* mask from the creating client */ PixUnion background; PixUnion border; - pointer backStorage; /* null when BS disabled */ + void *backStorage; /* null when BS disabled */ WindowOptPtr optional; unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */ unsigned borderIsPixel:1; diff --git a/xorg-server/include/xkbrules.h b/xorg-server/include/xkbrules.h index d21731884..956eade0b 100644 --- a/xorg-server/include/xkbrules.h +++ b/xorg-server/include/xkbrules.h @@ -30,40 +30,40 @@ /***====================================================================***/ typedef struct _XkbRMLVOSet { - char *rules; - char *model; - char *layout; - char *variant; - char *options; + const char *rules; + const char *model; + const char *layout; + const char *variant; + const char *options; } XkbRMLVOSet; typedef struct _XkbRF_VarDefs { - char *model; - char *layout; - char *variant; - char *options; + const char *model; + const char *layout; + const char *variant; + const char *options; } XkbRF_VarDefsRec, *XkbRF_VarDefsPtr; typedef struct _XkbRF_Rule { int number; int layout_num; int variant_num; - char *model; - char *layout; - char *variant; - char *option; + const char *model; + const char *layout; + const char *variant; + const char *option; /* yields */ - char *keycodes; - char *symbols; - char *types; - char *compat; - char *geometry; + const char *keycodes; + const char *symbols; + const char *types; + const char *compat; + const char *geometry; unsigned flags; } XkbRF_RuleRec, *XkbRF_RulePtr; typedef struct _XkbRF_Group { int number; - char *name; + const char *name; char *words; } XkbRF_GroupRec, *XkbRF_GroupPtr; diff --git a/xorg-server/include/xkbsrv.h b/xorg-server/include/xkbsrv.h index 346ebccf0..0b9ca06d9 100644 --- a/xorg-server/include/xkbsrv.h +++ b/xorg-server/include/xkbsrv.h @@ -281,7 +281,7 @@ extern _X_EXPORT DevPrivateKeyRec xkbDevicePrivateKeyRec; #define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr)dixLookupPrivate(&(dev)->devPrivates, xkbDevicePrivateKey)) -extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, pointer); +extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, void *); /***====================================================================***/ @@ -600,7 +600,7 @@ extern _X_EXPORT void XkbHandleBell(BOOL /* force */ , BOOL /* eventOnly */ , DeviceIntPtr /* kbd */ , CARD8 /* percent */ , - pointer /* ctrl */ , + void */* ctrl */ , CARD8 /* class */ , Atom /* name */ , WindowPtr /* pWin */ , @@ -852,7 +852,7 @@ extern _X_EXPORT unsigned int XkbDDXLoadKeymapByNames(DeviceIntPtr /* keybd */ , ); extern _X_EXPORT Bool XkbDDXNamesFromRules(DeviceIntPtr /* keybd */ , - char * /* rules */ , + const char * /* rules */ , XkbRF_VarDefsPtr /* defs */ , XkbComponentNamesPtr /* names */ ); diff --git a/xorg-server/mi/mi.h b/xorg-server/mi/mi.h index 638fc6bc7..950ee3812 100644 --- a/xorg-server/mi/mi.h +++ b/xorg-server/mi/mi.h @@ -271,7 +271,7 @@ extern _X_EXPORT void miPolyGlyphBlt(DrawablePtr /*pDrawable */ , int /*y */ , unsigned int /*nglyph */ , CharInfoPtr * /*ppci */ , - pointer /*pglyphBase */ + void */*pglyphBase */ ); extern _X_EXPORT void miImageGlyphBlt(DrawablePtr /*pDrawable */ , @@ -280,7 +280,7 @@ extern _X_EXPORT void miImageGlyphBlt(DrawablePtr /*pDrawable */ , int /*y */ , unsigned int /*nglyph */ , CharInfoPtr * /*ppci */ , - pointer /*pglyphBase */ + void */*pglyphBase */ ); /* mipoly.c */ @@ -387,7 +387,7 @@ extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr /*pPixmap */ , int /*depth */ , int /*bitsPerPixel */ , int /*devKind */ , - pointer /*pPixData */ + void */*pPixData */ ); extern _X_EXPORT Bool miCreateScreenResources(ScreenPtr /*pScreen */ @@ -395,11 +395,11 @@ extern _X_EXPORT Bool miCreateScreenResources(ScreenPtr /*pScreen */ extern _X_EXPORT Bool miScreenDevPrivateInit(ScreenPtr /*pScreen */ , int /*width */ , - pointer /*pbits */ + void */*pbits */ ); extern _X_EXPORT Bool miScreenInit(ScreenPtr /*pScreen */ , - pointer /*pbits */ , + void */*pbits */ , int /*xsize */ , int /*ysize */ , int /*dpix */ , diff --git a/xorg-server/mi/miarc.c b/xorg-server/mi/miarc.c index edb80bfe3..4dcdd42a1 100644 --- a/xorg-server/mi/miarc.c +++ b/xorg-server/mi/miarc.c @@ -1494,7 +1494,7 @@ miGetArcPts(SppArcPtr parc, /* points to an arc */ count++; cdt = 2 * miDcos(dt); - if (!(poly = (SppPointPtr) realloc((pointer) *ppPts, + if (!(poly = (SppPointPtr) realloc((void *) *ppPts, (cpt + count) * sizeof(SppPointRec)))) return 0; *ppPts = poly; diff --git a/xorg-server/mi/micmap.c b/xorg-server/mi/micmap.c index 90ca85d67..e2653cc1f 100644 --- a/xorg-server/mi/micmap.c +++ b/xorg-server/mi/micmap.c @@ -75,7 +75,7 @@ miUninstallColormap(ColormapPtr pmap) if (pmap == curpmap) { if (pmap->mid != pmap->pScreen->defColormap) { - dixLookupResourceByType((pointer *) &curpmap, + dixLookupResourceByType((void **) &curpmap, pmap->pScreen->defColormap, RT_COLORMAP, serverClient, DixUseAccess); (*pmap->pScreen->InstallColormap) (curpmap); diff --git a/xorg-server/mi/midispcur.c b/xorg-server/mi/midispcur.c index edca9696f..8cca5fe6e 100644 --- a/xorg-server/mi/midispcur.c +++ b/xorg-server/mi/midispcur.c @@ -79,7 +79,7 @@ typedef struct { (miDCBufferPtr)dixLookupScreenPrivate(&GetMaster(dev, MASTER_POINTER)->devPrivates, miDCDeviceKey, screen)) /* - * The core pointer buffer will point to the index of the virtual core pointer + * The core pointer buffer will point to the index of the virtual pointer * in the pCursorBuffers array. */ typedef struct { @@ -114,7 +114,7 @@ miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) dixSetPrivate(&pScreen->devPrivates, miDCScreenKey, pScreenPriv); if (!miSpriteInitialize(pScreen, screenFuncs)) { - free((pointer) pScreenPriv); + free((void *) pScreenPriv); return FALSE; } return TRUE; @@ -152,7 +152,7 @@ miDCCloseScreen(ScreenPtr pScreen) pScreen->CloseScreen = pScreenPriv->CloseScreen; miDCSwitchScreenCursor(pScreen, NULL, NULL, NULL, NULL); - free((pointer) pScreenPriv); + free((void *) pScreenPriv); return (*pScreen->CloseScreen) (pScreen); } diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c index b2f8bcf1e..284bdac8b 100644 --- a/xorg-server/mi/mieq.c +++ b/xorg-server/mi/mieq.c @@ -585,7 +585,7 @@ mieqProcessInputEvents(void) if (n_enqueued >= (miEventQueue.nevents - (2 * QUEUE_RESERVED_SIZE)) && miEventQueue.nevents < QUEUE_MAXIMUM_SIZE) { ErrorF("[mi] Increasing EQ size to %lu to prevent dropped events.\n", - miEventQueue.nevents << 1); + (unsigned long) (miEventQueue.nevents << 1)); if (!mieqGrowQueue(&miEventQueue, miEventQueue.nevents << 1)) { ErrorF("[mi] Increasing the size of EQ failed.\n"); } @@ -593,7 +593,7 @@ mieqProcessInputEvents(void) if (miEventQueue.dropped) { ErrorF("[mi] EQ processing has resumed after %lu dropped events.\n", - miEventQueue.dropped); + (unsigned long) miEventQueue.dropped); ErrorF ("[mi] This may be caused my a misbehaving driver monopolizing the server's resources.\n"); miEventQueue.dropped = 0; diff --git a/xorg-server/mi/miexpose.c b/xorg-server/mi/miexpose.c index 791687245..68d846fb6 100644 --- a/xorg-server/mi/miexpose.c +++ b/xorg-server/mi/miexpose.c @@ -610,7 +610,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) gcmask |= GCPlaneMask; #endif gcval[c++].val = FillTiled; - gcval[c++].ptr = (pointer) fill.pixmap; + gcval[c++].ptr = (void *) fill.pixmap; gcval[c++].val = tile_x_off; gcval[c++].val = tile_y_off; gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; diff --git a/xorg-server/mi/migc.c b/xorg-server/mi/migc.c index c9cdd12af..9bbe8846e 100644 --- a/xorg-server/mi/migc.c +++ b/xorg-server/mi/migc.c @@ -72,12 +72,12 @@ miDestroyClip(GCPtr pGC) } void -miChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +miChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { (*pGC->funcs->DestroyClip) (pGC); if (type == CT_PIXMAP) { /* convert the pixmap to a region */ - pGC->clientClip = (pointer) BitmapToRegion(pGC->pScreen, + pGC->clientClip = (void *) BitmapToRegion(pGC->pScreen, (PixmapPtr) pvalue); (*pGC->pScreen->DestroyPixmap) (pvalue); } @@ -86,7 +86,7 @@ miChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) pGC->clientClip = pvalue; } else if (type != CT_NONE) { - pGC->clientClip = (pointer) RegionFromRects(nrects, + pGC->clientClip = (void *) RegionFromRects(nrects, (xRectangle *) pvalue, type); free(pvalue); @@ -112,7 +112,7 @@ miCopyClip(GCPtr pgcDst, GCPtr pgcSrc) case CT_REGION: prgnNew = RegionCreate(NULL, 1); RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip)); - (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (pointer) prgnNew, 0); + (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (void *) prgnNew, 0); break; } } diff --git a/xorg-server/mi/migc.h b/xorg-server/mi/migc.h index 8c13b2e53..8d06a6f9f 100644 --- a/xorg-server/mi/migc.h +++ b/xorg-server/mi/migc.h @@ -26,31 +26,24 @@ from The Open Group. */ -extern _X_EXPORT void miChangeGC(GCPtr /*pGC */ , - unsigned long /*mask */ - ); - -extern _X_EXPORT void miDestroyGC(GCPtr /*pGC */ - ); - -extern _X_EXPORT void miDestroyClip(GCPtr /*pGC */ - ); - -extern _X_EXPORT void miChangeClip(GCPtr /*pGC */ , - int /*type */ , - pointer /*pvalue */ , - int /*nrects */ - ); - -extern _X_EXPORT void miCopyClip(GCPtr /*pgcDst */ , - GCPtr /*pgcSrc */ - ); - -extern _X_EXPORT void miCopyGC(GCPtr /*pGCSrc */ , - unsigned long /*changes */ , - GCPtr /*pGCDst */ - ); - -extern _X_EXPORT void miComputeCompositeClip(GCPtr /*pGC */ , - DrawablePtr /*pDrawable */ - ); +extern _X_EXPORT void miChangeGC(GCPtr pGC, + unsigned long mask); + +extern _X_EXPORT void miDestroyGC(GCPtr pGC); + +extern _X_EXPORT void miDestroyClip(GCPtr pGC); + +extern _X_EXPORT void miChangeClip(GCPtr pGC, + int type, + void *pvalue, + int nrects); + +extern _X_EXPORT void miCopyClip(GCPtr pgcDst, + GCPtr pgcSrc); + +extern _X_EXPORT void miCopyGC(GCPtr pGCSrc, + unsigned long changes, + GCPtr pGCDst); + +extern _X_EXPORT void miComputeCompositeClip(GCPtr pGC, + DrawablePtr pDrawable); diff --git a/xorg-server/mi/miglblt.c b/xorg-server/mi/miglblt.c index 1a70911fa..b53ab9c0e 100644 --- a/xorg-server/mi/miglblt.c +++ b/xorg-server/mi/miglblt.c @@ -81,7 +81,7 @@ with the sample server. void miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */ - pointer pglyphBase /* start of array of glyphs */ + void *pglyphBase /* start of array of glyphs */ ) { int width, height; @@ -182,7 +182,7 @@ miPolyGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyp void miImageGlyphBlt(DrawablePtr pDrawable, GC * pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */ - pointer pglyphBase /* start of array of glyphs */ + void *pglyphBase /* start of array of glyphs */ ) { ExtentInfoRec info; /* used by QueryGlyphExtents() */ diff --git a/xorg-server/mi/mioverlay.c b/xorg-server/mi/mioverlay.c index 14cd14ccb..ef67f386d 100644 --- a/xorg-server/mi/mioverlay.c +++ b/xorg-server/mi/mioverlay.c @@ -1054,7 +1054,7 @@ typedef struct { } miOverlayTwoRegions; static int -miOverlayRecomputeExposures(WindowPtr pWin, pointer value) +miOverlayRecomputeExposures(WindowPtr pWin, void *value) { miOverlayTwoRegions *pValid = (miOverlayTwoRegions *) value; miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); @@ -1408,7 +1408,7 @@ miOverlayResizeWindow(WindowPtr pWin, TwoRegions.under = gravitate2[g]; TraverseTree(pChild, miOverlayRecomputeExposures, - (pointer) (&TwoRegions)); + (void *) (&TwoRegions)); } /* diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c index 5d591a1dc..6fa416d9d 100644 --- a/xorg-server/mi/mipointer.c +++ b/xorg-server/mi/mipointer.c @@ -152,7 +152,7 @@ miPointerCloseScreen(ScreenPtr pScreen) SetupScreen(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; - free((pointer) pScreenPriv); + free((void *) pScreenPriv); FreeEventList(mipointermove_events, GetMaximumEventsNum()); mipointermove_events = NULL; return (*pScreen->CloseScreen) (pScreen); @@ -352,7 +352,6 @@ miPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) miPointerPtr pPointer; BOOL changedScreen = FALSE; - SetupScreen(pScreen); pPointer = MIPOINTER(pDev); if (pPointer->pScreen != pScreen) { @@ -465,14 +464,12 @@ miPointerUpdateSprite(DeviceIntPtr pDev) void miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) { - miPointerScreenPtr pScreenPriv; ScreenPtr pScreen; miPointerPtr pPointer; pPointer = MIPOINTER(pDev); pScreen = screenInfo.screens[screen_no]; - pScreenPriv = GetScreenPrivate(pScreen); mieqSwitchScreen(pDev, pScreen, FALSE); NewCurrentScreen(pDev, pScreen, x, y); diff --git a/xorg-server/mi/mipolyrect.c b/xorg-server/mi/mipolyrect.c index a0e88d2f2..e316ae053 100644 --- a/xorg-server/mi/mipolyrect.c +++ b/xorg-server/mi/mipolyrect.c @@ -148,7 +148,7 @@ miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects) } } (*pGC->ops->PolyFillRect) (pDraw, pGC, t - tmp, tmp); - free((pointer) tmp); + free((void *) tmp); } else { diff --git a/xorg-server/mi/miscrinit.c b/xorg-server/mi/miscrinit.c index 4698b532f..6aed52f51 100644 --- a/xorg-server/mi/miscrinit.c +++ b/xorg-server/mi/miscrinit.c @@ -53,14 +53,14 @@ from The Open Group. */ typedef struct { - pointer pbits; /* pointer to framebuffer */ + void *pbits; /* pointer to framebuffer */ int width; /* delta to add to a framebuffer addr to move one row down */ } miScreenInitParmsRec, *miScreenInitParmsPtr; /* this plugs into pScreen->ModifyPixmapHeader */ Bool miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, - int bitsPerPixel, int devKind, pointer pPixData) + int bitsPerPixel, int devKind, void *pPixData) { if (!pPixmap) return FALSE; @@ -135,7 +135,7 @@ Bool miCreateScreenResources(ScreenPtr pScreen) { miScreenInitParmsPtr pScrInitParms; - pointer value; + void *value; pScrInitParms = (miScreenInitParmsPtr) pScreen->devPrivate; @@ -161,7 +161,7 @@ miCreateScreenResources(ScreenPtr pScreen) pScreen->rootDepth), pScrInitParms->pbits)) return FALSE; - value = (pointer) pPixmap; + value = (void *) pPixmap; } else { value = pScrInitParms->pbits; @@ -172,7 +172,7 @@ miCreateScreenResources(ScreenPtr pScreen) } Bool -miScreenDevPrivateInit(ScreenPtr pScreen, int width, pointer pbits) +miScreenDevPrivateInit(ScreenPtr pScreen, int width, void *pbits) { miScreenInitParmsPtr pScrInitParms; @@ -185,7 +185,7 @@ miScreenDevPrivateInit(ScreenPtr pScreen, int width, pointer pbits) return FALSE; pScrInitParms->pbits = pbits; pScrInitParms->width = width; - pScreen->devPrivate = (pointer) pScrInitParms; + pScreen->devPrivate = (void *) pScrInitParms; return TRUE; } @@ -199,11 +199,11 @@ static void miSetScreenPixmap(PixmapPtr pPix) { if (pPix) - pPix->drawable.pScreen->devPrivate = (pointer) pPix; + pPix->drawable.pScreen->devPrivate = (void *) pPix; } Bool -miScreenInit(ScreenPtr pScreen, pointer pbits, /* pointer to screen bits */ +miScreenInit(ScreenPtr pScreen, void *pbits, /* pointer to screen bits */ int xsize, int ysize, /* in pixels */ int dpix, int dpiy, /* dots per inch */ int width, /* pixel width of frame buffer */ diff --git a/xorg-server/mi/misprite.c b/xorg-server/mi/misprite.c index bbd097b4f..5bc2f62f2 100644 --- a/xorg-server/mi/misprite.c +++ b/xorg-server/mi/misprite.c @@ -199,7 +199,7 @@ static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, static void miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); static void miSpriteBlockHandler(ScreenPtr pScreen, - pointer pTimeout, pointer pReadMask); + void *pTimeout, void *pReadMask); static void miSpriteInstallColormap(ColormapPtr pMap); static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef); @@ -512,8 +512,8 @@ miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } static void -miSpriteBlockHandler(ScreenPtr pScreen, pointer pTimeout, - pointer pReadmask) +miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout, + void *pReadmask) { miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); DeviceIntPtr pDev; diff --git a/xorg-server/mi/miwindow.c b/xorg-server/mi/miwindow.c index e341b79de..d9c46fd90 100644 --- a/xorg-server/mi/miwindow.c +++ b/xorg-server/mi/miwindow.c @@ -305,7 +305,7 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) */ static int -miRecomputeExposures(WindowPtr pWin, pointer value) +miRecomputeExposures(WindowPtr pWin, void *value) { /* must conform to VisitWindowProcPtr */ RegionPtr pValid = (RegionPtr) value; @@ -584,7 +584,7 @@ miSlideAndSizeWindow(WindowPtr pWin, if (pChild->winGravity != g) continue; RegionIntersect(pRegion, &pChild->borderClip, gravitate[g]); - TraverseTree(pChild, miRecomputeExposures, (pointer) pRegion); + TraverseTree(pChild, miRecomputeExposures, (void *) pRegion); } /* diff --git a/xorg-server/miext/damage/damage.c b/xorg-server/miext/damage/damage.c index 07c0579b4..f303249e2 100644 --- a/xorg-server/miext/damage/damage.c +++ b/xorg-server/miext/damage/damage.c @@ -326,7 +326,7 @@ static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); static void damageChangeGC(GCPtr, unsigned long); static void damageCopyGC(GCPtr, unsigned long, GCPtr); static void damageDestroyGC(GCPtr); -static void damageChangeClip(GCPtr, int, pointer, int); +static void damageChangeClip(GCPtr, int, void *, int); static void damageDestroyClip(GCPtr); static void damageCopyClip(GCPtr, GCPtr); @@ -359,7 +359,7 @@ damageCreateGC(GCPtr pGC) #define DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable) \ damageGCPriv(pGC); \ - GCFuncs *oldFuncs = pGC->funcs; \ + const GCFuncs *oldFuncs = pGC->funcs; \ unwrap(pGCPriv, pGC, funcs); \ unwrap(pGCPriv, pGC, ops); \ @@ -379,7 +379,6 @@ damageCreateGC(GCPtr pGC) static void damageValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { - drawableDamage(pDrawable); DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ValidateGC) (pGC, changes, pDrawable); pGCPriv->ops = pGC->ops; /* just so it's not NULL */ @@ -411,7 +410,7 @@ damageCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) } static void -damageChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +damageChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); @@ -1367,7 +1366,7 @@ damageImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr * ppci, pointer pglyphBase) + unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, @@ -1382,7 +1381,7 @@ damagePolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr * ppci, pointer pglyphBase) + unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, diff --git a/xorg-server/miext/damage/damagestr.h b/xorg-server/miext/damage/damagestr.h index 36753ee20..278615634 100644 --- a/xorg-server/miext/damage/damagestr.h +++ b/xorg-server/miext/damage/damagestr.h @@ -76,8 +76,8 @@ typedef struct _damageScrPriv { } DamageScrPrivRec, *DamageScrPrivPtr; typedef struct _damageGCPriv { - GCOps *ops; - GCFuncs *funcs; + const GCOps *ops; + const GCFuncs *funcs; } DamageGCPrivRec, *DamageGCPrivPtr; /* XXX should move these into damage.c, damageScrPrivateIndex is static */ diff --git a/xorg-server/miext/rootless/rootlessCommon.c b/xorg-server/miext/rootless/rootlessCommon.c index d8f43bd1b..504362790 100644 --- a/xorg-server/miext/rootless/rootlessCommon.c +++ b/xorg-server/miext/rootless/rootlessCommon.c @@ -202,7 +202,7 @@ RootlessStartDrawing(WindowPtr pWindow) * damaged regions are flushed to the screen. */ static int -RestorePreDrawingPixmapVisitor(WindowPtr pWindow, pointer data) +RestorePreDrawingPixmapVisitor(WindowPtr pWindow, void *data) { RootlessWindowRec *winRec = (RootlessWindowRec *) data; ScreenPtr pScreen = pWindow->drawable.pScreen; @@ -249,7 +249,7 @@ RootlessStopDrawing(WindowPtr pWindow, Bool flush) SCREENREC(pScreen)->imp->StopDrawing(winRec->wid, flush); FreeScratchPixmapHeader(winRec->pixmap); - TraverseTree(top, RestorePreDrawingPixmapVisitor, (pointer) winRec); + TraverseTree(top, RestorePreDrawingPixmapVisitor, (void *) winRec); winRec->pixmap = NULL; winRec->is_drawing = FALSE; diff --git a/xorg-server/miext/rootless/rootlessGC.c b/xorg-server/miext/rootless/rootlessGC.c index 526709350..71eaa11d1 100644 --- a/xorg-server/miext/rootless/rootlessGC.c +++ b/xorg-server/miext/rootless/rootlessGC.c @@ -58,7 +58,7 @@ static void RootlessValidateGC(GCPtr pGC, unsigned long changes, static void RootlessChangeGC(GCPtr pGC, unsigned long mask); static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); static void RootlessDestroyGC(GCPtr pGC); -static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); +static void RootlessChangeClip(GCPtr pGC, int type, void *pvalue, int nrects); static void RootlessDestroyClip(GCPtr pGC); static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc); @@ -116,10 +116,10 @@ static void RootlessImageText16(DrawablePtr dst, GCPtr pGC, int x, int y, int count, unsigned short *chars); static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyphInit, - CharInfoPtr * ppciInit, pointer unused); + CharInfoPtr * ppciInit, void *unused); static void RootlessPolyGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr * ppci, - pointer pglyphBase); + void *pglyphBase); static void RootlessPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr dst, int dx, int dy, int xOrg, int yOrg); @@ -371,7 +371,7 @@ RootlessDestroyGC(GCPtr pGC) } static void -RootlessChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) +RootlessChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) { GCFUNC_UNWRAP(pGC); pGC->funcs->ChangeClip(pGC, type, pvalue, nrects); @@ -1359,7 +1359,7 @@ RootlessPolyText16(DrawablePtr dst, GCPtr pGC, static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyphInit, - CharInfoPtr * ppciInit, pointer unused) + CharInfoPtr * ppciInit, void *unused) { GC_SAVE(pGC); GCOP_UNWRAP(pGC); @@ -1422,7 +1422,7 @@ RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC, static void RootlessPolyGlyphBlt(DrawablePtr dst, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) + CharInfoPtr * ppci, void *pglyphBase) { GCOP_UNWRAP(pGC); RL_DEBUG_MSG("polyglyph start "); diff --git a/xorg-server/miext/rootless/rootlessScreen.c b/xorg-server/miext/rootless/rootlessScreen.c index a1af3e7ac..6226ee84a 100644 --- a/xorg-server/miext/rootless/rootlessScreen.c +++ b/xorg-server/miext/rootless/rootlessScreen.c @@ -603,7 +603,7 @@ RootlessQueueRedisplay(ScreenPtr pScreen) * on select(). */ static void -RootlessBlockHandler(pointer pbdata, OSTimePtr pTimeout, pointer pReadmask) +RootlessBlockHandler(void *pbdata, OSTimePtr pTimeout, void *pReadmask) { ScreenPtr pScreen = pbdata; RootlessScreenRec *screenRec = SCREENREC(pScreen); @@ -616,7 +616,7 @@ RootlessBlockHandler(pointer pbdata, OSTimePtr pTimeout, pointer pReadmask) } static void -RootlessWakeupHandler(pointer data, int i, pointer LastSelectMask) +RootlessWakeupHandler(void *data, int i, void *LastSelectMask) { // nothing here } @@ -728,7 +728,7 @@ RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs) if (!RegisterBlockAndWakeupHandlers(RootlessBlockHandler, RootlessWakeupHandler, - (pointer) pScreen)) { + (void *) pScreen)) { return FALSE; } diff --git a/xorg-server/miext/rootless/rootlessWindow.c b/xorg-server/miext/rootless/rootlessWindow.c index cf1611c1e..7b9be2cfe 100644 --- a/xorg-server/miext/rootless/rootlessWindow.c +++ b/xorg-server/miext/rootless/rootlessWindow.c @@ -631,7 +631,7 @@ RootlessRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) */ // Globals needed during window resize and move. -static pointer gResizeDeathBits = NULL; +static void *gResizeDeathBits = NULL; static int gResizeDeathCount = 0; static PixmapPtr gResizeDeathPix[2] = { NULL, NULL }; diff --git a/xorg-server/miext/shadow/shadow.c b/xorg-server/miext/shadow/shadow.c index 1a9088c43..522e21bd0 100644 --- a/xorg-server/miext/shadow/shadow.c +++ b/xorg-server/miext/shadow/shadow.c @@ -65,7 +65,7 @@ shadowRedisplay(ScreenPtr pScreen) } static void -shadowBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead) +shadowBlockHandler(void *data, OSTimePtr pTimeout, void *pRead) { ScreenPtr pScreen = (ScreenPtr) data; @@ -73,7 +73,7 @@ shadowBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead) } static void -shadowWakeupHandler(pointer data, int i, pointer LastSelectMask) +shadowWakeupHandler(void *data, int i, void *LastSelectMask) { } @@ -183,7 +183,7 @@ shadowAdd(ScreenPtr pScreen, PixmapPtr pPixmap, ShadowUpdateProc update, shadowBuf(pScreen); if (!RegisterBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, - (pointer) pScreen)) + (void *) pScreen)) return FALSE; /* @@ -228,7 +228,7 @@ shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap) } RemoveBlockAndWakeupHandlers(shadowBlockHandler, shadowWakeupHandler, - (pointer) pScreen); + (void *) pScreen); } Bool diff --git a/xorg-server/os/WaitFor.c b/xorg-server/os/WaitFor.c index ffa740fe4..ffc896176 100644 --- a/xorg-server/os/WaitFor.c +++ b/xorg-server/os/WaitFor.c @@ -118,7 +118,7 @@ struct _OsTimerRec { CARD32 expires; CARD32 delta; OsTimerCallback callback; - pointer arg; + void *arg; }; static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev); @@ -218,7 +218,7 @@ WaitForSomething(int *pClientsReady) XFD_COPYSET(&AllSockets, &LastSelectMask); } - BlockHandler((pointer) &wt, (pointer) &LastSelectMask); + BlockHandler((void *) &wt, (void *) &LastSelectMask); if (NewOutputPending) FlushAllOutput(); /* keep this check close to select() call to minimize race */ @@ -232,7 +232,7 @@ WaitForSomething(int *pClientsReady) i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); } selecterr = GetErrno(); - WakeupHandler(i, (pointer) &LastSelectMask); + WakeupHandler(i, (void *) &LastSelectMask); if (i <= 0) { /* An error or timeout occurred */ if (dispatchException) return 0; @@ -309,7 +309,7 @@ WaitForSomething(int *pClientsReady) XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections); if (XFD_ANYSET(&tmp_set)) QueueWorkProc(EstablishNewConnections, NULL, - (pointer) &LastSelectMask); + (void *) &LastSelectMask); if (XFD_ANYSET(&devicesReadable) || XFD_ANYSET(&clientsReadable)) break; @@ -422,7 +422,7 @@ DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev) OsTimerPtr TimerSet(OsTimerPtr timer, int flags, CARD32 millis, - OsTimerCallback func, pointer arg) + OsTimerCallback func, void *arg) { register OsTimerPtr *prev; CARD32 now = GetTimeInMillis(); @@ -570,7 +570,7 @@ NextDPMSTimeout(INT32 timeout) #endif /* DPMSExtension */ static CARD32 -ScreenSaverTimeoutExpire(OsTimerPtr timer, CARD32 now, pointer arg) +ScreenSaverTimeoutExpire(OsTimerPtr timer, CARD32 now, void *arg) { INT32 timeout = now - LastEventTime(XIAllDevices).milliseconds; CARD32 nextTimeout = 0; diff --git a/xorg-server/os/access.c b/xorg-server/os/access.c index c8e15cfea..62c3d9925 100644..100755 --- a/xorg-server/os/access.c +++ b/xorg-server/os/access.c @@ -186,7 +186,7 @@ Bool defeatAccessControl = FALSE; static int ConvertAddr(struct sockaddr * /*saddr */ , int * /*len */ , - pointer * /*addr */ ); + void ** /*addr */ ); static int CheckAddr(int /*family */ , const void * /*pAddr */ , @@ -230,7 +230,7 @@ static int ActiveInterfaces = 0; void match_interface(u_long u_lQuery); /* FamilyServerInterpreted implementation */ -static Bool siAddrMatch(int family, pointer addr, int len, HOST * host, +static Bool siAddrMatch(int family, void *addr, int len, HOST * host, ClientPtr client); static int siCheckAddr(const char *addrString, int length); static void siTypesInitialize(void); @@ -340,7 +340,7 @@ DisableLocalHost(void) for (self = selfhosts; self; self = self->next) { if (!self->requested) /* Fix for XFree86 bug #156 */ (void) RemoveHost((ClientPtr) NULL, self->family, self->len, - (pointer) self->addr); + (void *) self->addr); } } @@ -550,7 +550,7 @@ CarryOnTheOldWay: else if (i == j) continue; else memcpy ( &(inetaddr->sin_addr), hp->h_addr_list[i], hp->h_length); len = sizeof(saddr.sa); - family = ConvertAddr(&(saddr.sa), &len, (pointer *) &addr); + family = ConvertAddr(&(saddr.sa), &len, (void **) &addr); if ( family != -1 && family != FamilyLocal ) { for (host = selfhosts; host && !addrEqual (family, addr, len, host); @@ -715,7 +715,7 @@ DefineSelf(int fd) #define IFR_IFR_NAME ifr->ifr_name #endif - if (ifioctl(fd, IFC_IOCTL_REQ, (pointer) &ifc) < 0) + if (ifioctl(fd, IFC_IOCTL_REQ, (void *) &ifc) < 0) ErrorF("Getting interface configuration (4): %s\n", strerror(errno)); cplim = (char *) IFC_IFC_REQ + IFC_IFC_LEN; @@ -724,7 +724,7 @@ DefineSelf(int fd) ifr = (ifr_type *) cp; len = ifraddr_size(IFR_IFR_ADDR); family = ConvertAddr((struct sockaddr *) &IFR_IFR_ADDR, - &len, (pointer *) &addr); + &len, (void **) &addr); if (family == -1 || family == FamilyLocal) continue; #if defined(IPv6) && defined(AF_INET6) @@ -819,12 +819,12 @@ DefineSelf(int fd) struct ifreq broad_req; broad_req = *ifr; - if (ifioctl(fd, SIOCGIFFLAGS, (pointer) &broad_req) != -1 && + if (ifioctl(fd, SIOCGIFFLAGS, (void *) &broad_req) != -1 && (broad_req.ifr_flags & IFF_BROADCAST) && (broad_req.ifr_flags & IFF_UP) ) { broad_req = *ifr; - if (ifioctl(fd, SIOCGIFBRDADDR, (pointer) &broad_req) != -1) + if (ifioctl(fd, SIOCGIFBRDADDR, (void *) &broad_req) != -1) broad_addr = broad_req.ifr_addr; else continue; @@ -849,7 +849,7 @@ DefineSelf(int fd) continue; len = sizeof(*(ifr->ifa_addr)); family = ConvertAddr((struct sockaddr *) ifr->ifa_addr, &len, - (pointer *) &addr); + (void **) &addr); if (family == -1 || family == FamilyLocal) continue; #if defined(IPv6) && defined(AF_INET6) @@ -945,13 +945,13 @@ DefineSelf(int fd) #ifdef XDMCP void -AugmentSelf(pointer from, int len) +AugmentSelf(void *from, int len) { int family; - pointer addr; + void *addr; register HOST *host; - family = ConvertAddr(from, &len, (pointer *) &addr); + family = ConvertAddr(from, &len, (void **) &addr); if (family == -1 || family == FamilyLocal) return; for (host = selfhosts; host; host = host->next) { @@ -984,7 +984,7 @@ AddLocalHosts(void) /* Reset access control list to initial hosts */ void -ResetHosts(char *display) +ResetHosts(const char *display) { register HOST *host; char lhostname[120], ohostname[120]; @@ -1005,7 +1005,7 @@ ResetHosts(char *display) } saddr; #endif int family = 0; - pointer addr; + void *addr; int len; siTypesInitialize(); @@ -1102,7 +1102,7 @@ ResetHosts(char *display) for (a = addresses; a != NULL; a = a->ai_next) { len = a->ai_addrlen; f = ConvertAddr(a->ai_addr, &len, - (pointer *) &addr); + (void **) &addr); if ((family == f) || ((family == FamilyWild) && (f != -1))) { NewHost(f, addr, len, FALSE); @@ -1125,15 +1125,15 @@ ResetHosts(char *display) len = sizeof(saddr.sa); if ((family = ConvertAddr(&saddr.sa, &len, - (pointer *) &addr)) != -1) { + (void **) &addr)) != -1) { #ifdef h_addr /* new 4.3bsd version of gethostent */ char **list; /* iterate over the addresses */ for (list = hp->h_addr_list; *list; list++) - (void) NewHost(family, (pointer) *list, len, FALSE); + (void) NewHost(family, (void *) *list, len, FALSE); #else - (void) NewHost(family, (pointer) hp->h_addr, len, + (void) NewHost(family, (void *) hp->h_addr, len, FALSE); #endif } @@ -1153,7 +1153,7 @@ ComputeLocalClient(ClientPtr client) { int alen, family, notused; Xtransaddr *from = NULL; - pointer addr; + void *addr; register HOST *host; OsCommPtr oc = (OsCommPtr) client->osPrivate; @@ -1162,7 +1162,7 @@ ComputeLocalClient(ClientPtr client) if (!_XSERVTransGetPeerAddr(oc->trans_conn, ¬used, &alen, &from)) { family = ConvertAddr((struct sockaddr *) from, - &alen, (pointer *) &addr); + &alen, (void **) &addr); if (family == -1) { free(from); return FALSE; @@ -1394,8 +1394,8 @@ AddHost(ClientPtr client, int family, unsigned length, /* of bytes in pAddr */ Bool ForEachHostInFamily(int family, Bool (*func) (unsigned char * /* addr */ , short /* len */ , - pointer /* closure */ ), - pointer closure) + void */* closure */ ), + void *closure) { HOST *host; @@ -1441,7 +1441,7 @@ NewHost(int family, const void *addr, int len, int addingLocalHosts) int RemoveHost(ClientPtr client, int family, unsigned length, /* of bytes in pAddr */ - pointer pAddr) + void *pAddr) { int rc, len; register HOST *host, **prev; @@ -1488,7 +1488,7 @@ RemoveHost(ClientPtr client, int family, unsigned length, /* of bytes in p /* Get all hosts in the access control list */ int -GetHosts(pointer *data, int *pnHosts, int *pLen, BOOL * pEnabled) +GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled) { int len; register int n = 0; @@ -1563,12 +1563,12 @@ int InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client) { int family; - pointer addr; + void *addr; register HOST *selfhost, *host; if (!AccessEnabled) /* just let them in */ return 0; - family = ConvertAddr(saddr, &len, (pointer *) &addr); + family = ConvertAddr(saddr, &len, (void **) &addr); if (family == -1) return 1; if (family == FamilyLocal) { @@ -1604,7 +1604,7 @@ InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client) } static int -ConvertAddr(register struct sockaddr *saddr, int *len, pointer *addr) +ConvertAddr(register struct sockaddr *saddr, int *len, void **addr) { if (*len == 0) return FamilyLocal; @@ -1621,7 +1621,7 @@ ConvertAddr(register struct sockaddr *saddr, int *len, pointer *addr) return FamilyLocal; #endif *len = sizeof(struct in_addr); - *addr = (pointer) &(((struct sockaddr_in *) saddr)->sin_addr); + *addr = (void *) &(((struct sockaddr_in *) saddr)->sin_addr); return FamilyInternet; #if defined(IPv6) && defined(AF_INET6) case AF_INET6: @@ -1630,12 +1630,12 @@ ConvertAddr(register struct sockaddr *saddr, int *len, pointer *addr) if (IN6_IS_ADDR_V4MAPPED(&(saddr6->sin6_addr))) { *len = sizeof(struct in_addr); - *addr = (pointer) &(saddr6->sin6_addr.s6_addr[12]); + *addr = (void *) &(saddr6->sin6_addr.s6_addr[12]); return FamilyInternet; } else { *len = sizeof(struct in6_addr); - *addr = (pointer) &(saddr6->sin6_addr); + *addr = (void *) &(saddr6->sin6_addr); return FamilyInternet6; } } @@ -1682,7 +1682,7 @@ GetAccessControl(void) * future to enable loading additional host types, but that was not done for * the initial implementation. */ -typedef Bool (*siAddrMatchFunc) (int family, pointer addr, int len, +typedef Bool (*siAddrMatchFunc) (int family, void *addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *siTypePriv); typedef int (*siCheckAddrFunc) (const char *addrString, int length, @@ -1735,7 +1735,7 @@ siTypeAdd(const char *typeName, siAddrMatchFunc addrMatch, /* Checks to see if a host matches a server-interpreted host entry */ static Bool -siAddrMatch(int family, pointer addr, int len, HOST * host, ClientPtr client) +siAddrMatch(int family, void *addr, int len, HOST * host, ClientPtr client) { Bool matches = FALSE; struct siType *s; @@ -1836,7 +1836,7 @@ siCheckAddr(const char *addrString, int length) #endif static Bool -siHostnameAddrMatch(int family, pointer addr, int len, +siHostnameAddrMatch(int family, void *addr, int len, const char *siAddr, int siAddrLen, ClientPtr client, void *typePriv) { @@ -1853,7 +1853,7 @@ siHostnameAddrMatch(int family, pointer addr, int len, struct addrinfo *a; struct addrinfo hints; int f, hostaddrlen; - pointer hostaddr; + void *hostaddr; if (siAddrLen >= sizeof(hostname)) return FALSE; @@ -1885,7 +1885,7 @@ siHostnameAddrMatch(int family, pointer addr, int len, #endif char hostname[SI_HOSTNAME_MAXLEN]; int f, hostaddrlen; - pointer hostaddr; + void *hostaddr; const char **addrlist; if (siAddrLen >= sizeof(hostname)) @@ -1989,7 +1989,7 @@ siHostnameCheckAddr(const char *valueString, int length, void *typePriv) #define SI_IPv6_MAXLEN INET6_ADDRSTRLEN static Bool -siIPv6AddrMatch(int family, pointer addr, int len, +siIPv6AddrMatch(int family, void *addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *typePriv) { @@ -2115,7 +2115,7 @@ siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id) } static Bool -siLocalCredAddrMatch(int family, pointer addr, int len, +siLocalCredAddrMatch(int family, void *addr, int len, const char *siAddr, int siAddrlen, ClientPtr client, void *typePriv) { diff --git a/xorg-server/os/auth.c b/xorg-server/os/auth.c index b95786bee..df05a5717 100644 --- a/xorg-server/os/auth.c +++ b/xorg-server/os/auth.c @@ -96,12 +96,12 @@ static struct protocol protocols[] = { * specified authorization file */ -static char *authorization_file = (char *) NULL; +static const char *authorization_file = NULL; static Bool ShouldLoadAuth = TRUE; void -InitAuthorization(char *file_name) +InitAuthorization(const char *file_name) { authorization_file = file_name; } diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c index 99f0da06c..7c48d46b0 100644 --- a/xorg-server/os/connection.c +++ b/xorg-server/os/connection.c @@ -797,7 +797,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) oc->output = (ConnectionOutputPtr) NULL; oc->auth_id = None; oc->conn_time = conn_time; - if (!(client = NextAvailableClient((pointer) oc))) { + if (!(client = NextAvailableClient((void *) oc))) { free(oc); return NullClient; } @@ -835,7 +835,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) *****************/ /*ARGSUSED*/ Bool -EstablishNewConnections(ClientPtr clientUnused, pointer closure) +EstablishNewConnections(ClientPtr clientUnused, void *closure) { fd_set readyconnections; /* set of listeners that are ready */ int curconn; /* fd of listener that's ready */ @@ -1093,7 +1093,7 @@ CloseDownConnection(ClientPtr client) CloseDownFileDescriptor(oc); FreeOsBuffers(oc); free(client->osPrivate); - client->osPrivate = (pointer) NULL; + client->osPrivate = (void *) NULL; if (auditTrailLevel > 1) AuditF("client %d disconnected\n", client->index); } diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c index 9f0842672..1303f3ab1 100644 --- a/xorg-server/os/io.c +++ b/xorg-server/os/io.c @@ -481,7 +481,7 @@ ReadRequestFromClient(ClientPtr client) oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq)); client->req_len -= bytes_to_int32(sizeof(xBigReq) - sizeof(xReq)); } - client->requestBuffer = (pointer) oci->bufptr; + client->requestBuffer = (void *) oci->bufptr; #ifdef DEBUG_COMMUNICATION { xReq *req = client->requestBuffer; @@ -809,7 +809,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf) who->replyBytesRemaining -= count + padBytes; replyinfo.startOfReply = FALSE; replyinfo.bytesRemaining = who->replyBytesRemaining; - CallCallbacks((&ReplyCallback), (pointer) &replyinfo); + CallCallbacks((&ReplyCallback), (void *) &replyinfo); } else if (who->clientState == ClientStateRunning && buf[0] == X_Reply) { /* start of new reply */ CARD32 replylen; @@ -821,7 +821,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf) bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes; replyinfo.startOfReply = TRUE; replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft; - CallCallbacks((&ReplyCallback), (pointer) &replyinfo); + CallCallbacks((&ReplyCallback), (void *) &replyinfo); } } #ifdef DEBUG_COMMUNICATION diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index a85ec9c2e..b2fcae1b3 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -832,7 +832,7 @@ AuditF(const char *f, ...) } static CARD32 -AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) +AuditFlush(OsTimerPtr timer, CARD32 now, void *arg) { char *prefix; diff --git a/xorg-server/os/rpcauth.c b/xorg-server/os/rpcauth.c index bd219acfa..d60ea3518 100644 --- a/xorg-server/os/rpcauth.c +++ b/xorg-server/os/rpcauth.c @@ -113,7 +113,7 @@ authdes_ezdecode(const char *inmsg, int len) static XID rpc_id = (XID) ~0L; static Bool -CheckNetName(unsigned char *addr, short len, pointer closure) +CheckNetName(unsigned char *addr, short len, void *closure) { return (len == strlen((char *) closure) && strncmp((char *) addr, (char *) closure, len) == 0); @@ -159,7 +159,7 @@ _X_HIDDEN int SecureRPCAdd(unsigned short data_length, const char *data, XID id) { if (data_length) - AddHost((pointer) 0, FamilyNetname, data_length, data); + AddHost((void *) 0, FamilyNetname, data_length, data); rpc_id = id; return 1; } diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index f878f28b2..aeb276fa4 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -511,7 +511,7 @@ GetTimeInMicros(void) #endif void -AdjustWaitForDelay(pointer waitTime, unsigned long newdelay) +AdjustWaitForDelay(void *waitTime, unsigned long newdelay) { static struct timeval delay_val; struct timeval **wt = (struct timeval **) waitTime; @@ -1006,7 +1006,7 @@ ProcessCommandLine(int argc, char *argv[]) /* Implement a simple-minded font authorization scheme. The authorization name is "hp-hostname-1", the contents are simply the host name. */ int -set_font_authorizations(char **authorizations, int *authlen, pointer client) +set_font_authorizations(char **authorizations, int *authlen, void *client) { #define AUTHORIZATION_NAME "hp-hostname-1" #if defined(TCPCONN) || defined(STREAMSCONN) @@ -1443,7 +1443,7 @@ static struct pid { OsSigHandlerPtr old_alarm = NULL; /* XXX horrible awful hack */ -pointer +void * Popen(const char *command, const char *type) { struct pid *cur; @@ -1531,7 +1531,7 @@ Popen(const char *command, const char *type) } /* fopen that drops privileges */ -pointer +void * Fopen(const char *file, const char *type) { FILE *iop; @@ -1626,7 +1626,7 @@ Fopen(const char *file, const char *type) } int -Pclose(pointer iop) +Pclose(void *iop) { struct pid *cur, *last; int pstat; @@ -1663,7 +1663,7 @@ Pclose(pointer iop) } int -Fclose(pointer iop) +Fclose(void *iop) { #ifdef HAS_SAVED_IDS_AND_SETEUID return fclose(iop); @@ -2004,10 +2004,10 @@ CheckUserAuthorization(void) * Tokenize a string into a NULL terminated array of strings. Always returns * an allocated array unless an error occurs. */ -char ** +const char ** xstrtokenize(const char *str, const char *separators) { - char **list, **nlist; + const char **list, **nlist; char *tok, *tmp; unsigned num = 0, n; @@ -2035,7 +2035,7 @@ xstrtokenize(const char *str, const char *separators) error: free(tmp); for (n = 0; n < num; n++) - free(list[n]); + free((void *) list[n]); free(list); return NULL; } diff --git a/xorg-server/os/xdmcp.c b/xorg-server/os/xdmcp.c index c18e90248..3ce2b9f6b 100644 --- a/xorg-server/os/xdmcp.c +++ b/xorg-server/os/xdmcp.c @@ -147,43 +147,46 @@ static void get_xdmcp_sock(void); static void send_query_msg(void); -static void recv_willing_msg(struct sockaddr * /*from */ , - int /*fromlen */ , - unsigned /*length */ ); +static void recv_willing_msg(struct sockaddr *from, + int fromlen, + unsigned length); static void send_request_msg(void); -static void recv_accept_msg(unsigned /*length */ ); +static void recv_accept_msg(unsigned length); -static void recv_decline_msg(unsigned /*length */ ); +static void recv_decline_msg(unsigned length); static void send_manage_msg(void); -static void recv_refuse_msg(unsigned /*length */ ); +static void recv_refuse_msg(unsigned length); -static void recv_failed_msg(unsigned /*length */ ); +static void recv_failed_msg(unsigned length); static void send_keepalive_msg(void); -static void recv_alive_msg(unsigned /*length */ ); +static void recv_alive_msg(unsigned length ); -static void XdmcpFatal(const char * /*type */ , - ARRAY8Ptr /*status */ ); +static void XdmcpFatal(const char *type, + ARRAY8Ptr status); -static void XdmcpWarning(const char * /*str */ ); +static void XdmcpWarning(const char *str); -static void get_manager_by_name(int /*argc */ , - char ** /*argv */ , - int /*i */ ); +static void get_manager_by_name(int argc, + char **argv, + int i); -static void get_fromaddr_by_name(int /*argc */ , char ** /*argv */ , - int /*i */ ); +static void get_fromaddr_by_name(int argc, + char **argv, + int i); #if defined(IPv6) && defined(AF_INET6) -static int get_mcast_options(int /*argc */ , char ** /*argv */ , int /*i */ ); +static int get_mcast_options(int argc, + char **argv, + int i); #endif -static void receive_packet(int /*socketfd */ ); +static void receive_packet(int socketfd); static void send_packet(void); @@ -191,13 +194,13 @@ static void timeout(void); static void restart(void); -static void XdmcpBlockHandler(pointer /*data */ , - struct timeval ** /*wt */ , - pointer /*LastSelectMask */ ); +static void XdmcpBlockHandler(void *data , + struct timeval **wt, + void *LastSelectMask); -static void XdmcpWakeupHandler(pointer /*data */ , - int /*i */ , - pointer /*LastSelectMask */ ); +static void XdmcpWakeupHandler(void *data, + int i, + void *LastSelectMask); #define XSERV_t #define TRANS_SERVER @@ -585,7 +588,7 @@ XdmcpInit(void) strlen(defaultDisplayClass)); AccessUsingXdmcp(); RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, - (pointer) 0); + (void *) 0); timeOutRtx = 0; DisplayNumber = (CARD16) atoi(display); if (ConnectionTypes.length>1 && xdm_from==NULL) @@ -625,7 +628,7 @@ XdmcpReset(void) state = XDM_INIT_STATE; if (state != XDM_OFF) { RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, - (pointer) 0); + (void *) 0); timeOutRtx = 0; send_packet(); } @@ -668,8 +671,8 @@ XdmcpCloseDisplay(int sock) */ /*ARGSUSED*/ static void -XdmcpBlockHandler(pointer data, /* unused */ - struct timeval **wt, pointer pReadmask) +XdmcpBlockHandler(void *data, /* unused */ + struct timeval **wt, void *pReadmask) { fd_set *LastSelectMask = (fd_set *) pReadmask; CARD32 millisToGo; @@ -696,8 +699,8 @@ XdmcpBlockHandler(pointer data, /* unused */ */ /*ARGSUSED*/ static void -XdmcpWakeupHandler(pointer data, /* unused */ - int i, pointer pReadmask) +XdmcpWakeupHandler(void *data, /* unused */ + int i, void *pReadmask) { fd_set *LastSelectMask = (fd_set *) pReadmask; fd_set devicesReadable; diff --git a/xorg-server/present/present.c b/xorg-server/present/present.c index 638bfb965..1bb459592 100644 --- a/xorg-server/present/present.c +++ b/xorg-server/present/present.c @@ -318,7 +318,7 @@ struct pixmap_visit { }; static int -present_set_tree_pixmap_visit(WindowPtr window, pointer data) +present_set_tree_pixmap_visit(WindowPtr window, void *data) { struct pixmap_visit *visit = data; ScreenPtr screen = window->drawable.pScreen; diff --git a/xorg-server/present/present_event.c b/xorg-server/present/present_event.c index 3d0aaa799..5582e51a6 100644 --- a/xorg-server/present/present_event.c +++ b/xorg-server/present/present_event.c @@ -29,7 +29,7 @@ RESTYPE present_event_type; static int -present_free_event(pointer data, XID id) +present_free_event(void *data, XID id) { present_event_ptr present_event = (present_event_ptr) data; present_window_priv_ptr window_priv = present_window_priv(present_event->window); @@ -41,7 +41,7 @@ present_free_event(pointer data, XID id) break; } } - free((pointer) present_event); + free((void *) present_event); return 1; } @@ -226,7 +226,7 @@ present_select_input(ClientPtr client, XID eid, WindowPtr window, CARD32 mask) event->next = window_priv->events; window_priv->events = event; - if (!AddResource(event->id, present_event_type, (pointer) event)) + if (!AddResource(event->id, present_event_type, (void *) event)) return BadAlloc; return Success; diff --git a/xorg-server/present/present_fake.c b/xorg-server/present/present_fake.c index 7926f7a4c..1c80f5986 100644 --- a/xorg-server/present/present_fake.c +++ b/xorg-server/present/present_fake.c @@ -58,7 +58,7 @@ present_fake_notify(ScreenPtr screen, uint64_t event_id) static CARD32 present_fake_do_timer(OsTimerPtr timer, CARD32 time, - pointer arg) + void *arg) { present_fake_vblank_ptr fake_vblank = arg; diff --git a/xorg-server/present/present_request.c b/xorg-server/present/present_request.c index 275a29cdc..c69e68309 100644 --- a/xorg-server/present/present_request.c +++ b/xorg-server/present/present_request.c @@ -90,7 +90,7 @@ proc_present_pixmap(ClientPtr client) ret = dixLookupWindow(&window, stuff->window, client, DixWriteAccess); if (ret != Success) return ret; - ret = dixLookupResourceByType((pointer *) &pixmap, stuff->pixmap, RT_PIXMAP, client, DixReadAccess); + ret = dixLookupResourceByType((void **) &pixmap, stuff->pixmap, RT_PIXMAP, client, DixReadAccess); if (ret != Success) return ret; diff --git a/xorg-server/randr/randr.c b/xorg-server/randr/randr.c index 87729e430..19b430721 100644 --- a/xorg-server/randr/randr.c +++ b/xorg-server/randr/randr.c @@ -60,7 +60,7 @@ DevPrivateKeyRec RRClientPrivateKeyRec; DevPrivateKeyRec rrPrivKeyRec; static void -RRClientCallback(CallbackListPtr *list, pointer closure, pointer data) +RRClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -338,7 +338,7 @@ RRScreenInit(ScreenPtr pScreen) } /*ARGSUSED*/ static int -RRFreeClient(pointer data, XID id) +RRFreeClient(void *data, XID id) { RREventPtr pRREvent; WindowPtr pWin; @@ -346,7 +346,7 @@ RRFreeClient(pointer data, XID id) pRREvent = (RREventPtr) data; pWin = pRREvent->window; - dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + dixLookupResourceByType((void **) &pHead, pWin->drawable.id, RREventType, serverClient, DixDestroyAccess); if (pHead) { pPrev = 0; @@ -359,12 +359,12 @@ RRFreeClient(pointer data, XID id) *pHead = pRREvent->next; } } - free((pointer) pRREvent); + free((void *) pRREvent); return 1; } /*ARGSUSED*/ static int -RRFreeEvents(pointer data, XID id) +RRFreeEvents(void *data, XID id) { RREventPtr *pHead, pCur, pNext; @@ -372,9 +372,9 @@ RRFreeEvents(pointer data, XID id) for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; FreeResource(pCur->clientResource, RRClientType); - free((pointer) pCur); + free((void *) pCur); } - free((pointer) pHead); + free((void *) pHead); return 1; } @@ -448,7 +448,7 @@ RRDeliverResourceEvent(ClientPtr client, WindowPtr pWin) } static int -TellChanged(WindowPtr pWin, pointer value) +TellChanged(WindowPtr pWin, void *value) { RREventPtr *pHead, pRREvent; ClientPtr client; @@ -459,7 +459,7 @@ TellChanged(WindowPtr pWin, pointer value) rrScrPriv(pScreen); int i; - dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + dixLookupResourceByType((void **) &pHead, pWin->drawable.id, RREventType, serverClient, DixReadAccess); if (!pHead) return WT_WALKCHILDREN; @@ -590,7 +590,7 @@ RRTellChanged(ScreenPtr pScreen) pScrPriv->changed = FALSE; mastersp->changed = FALSE; - WalkTree(master, TellChanged, (pointer) master); + WalkTree(master, TellChanged, (void *) master); mastersp->resourcesChanged = FALSE; diff --git a/xorg-server/randr/randrstr.h b/xorg-server/randr/randrstr.h index 15299fd6d..e14223201 100644 --- a/xorg-server/randr/randrstr.h +++ b/xorg-server/randr/randrstr.h @@ -92,7 +92,7 @@ struct _rrPropertyValue { Atom type; /* ignored by server */ short format; /* format of data for swapping - 8,16,32 */ long size; /* size of data in (format/8) bytes */ - pointer data; /* private to client */ + void *data; /* private to client */ }; struct _rrProperty { @@ -385,7 +385,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; #define VERIFY_RR_OUTPUT(id, ptr, a)\ {\ - int rc = dixLookupResourceByType((pointer *)&(ptr), id,\ + int rc = dixLookupResourceByType((void **)&(ptr), id,\ RROutputType, client, a);\ if (rc != Success) {\ client->errorValue = id;\ @@ -395,7 +395,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; #define VERIFY_RR_CRTC(id, ptr, a)\ {\ - int rc = dixLookupResourceByType((pointer *)&(ptr), id,\ + int rc = dixLookupResourceByType((void **)&(ptr), id,\ RRCrtcType, client, a);\ if (rc != Success) {\ client->errorValue = id;\ @@ -405,7 +405,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; #define VERIFY_RR_MODE(id, ptr, a)\ {\ - int rc = dixLookupResourceByType((pointer *)&(ptr), id,\ + int rc = dixLookupResourceByType((void **)&(ptr), id,\ RRModeType, client, a);\ if (rc != Success) {\ client->errorValue = id;\ @@ -415,7 +415,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; #define VERIFY_RR_PROVIDER(id, ptr, a)\ {\ - int rc = dixLookupResourceByType((pointer *)&(ptr), id,\ + int rc = dixLookupResourceByType((void **)&(ptr), id,\ RRProviderType, client, a);\ if (rc != Success) {\ client->errorValue = id;\ @@ -871,7 +871,7 @@ extern _X_EXPORT int RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent, Bool pending); + void *value, Bool sendevent, Bool pending); extern _X_EXPORT int @@ -948,7 +948,7 @@ extern _X_EXPORT void extern _X_EXPORT int RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent, Bool pending); + void *value, Bool sendevent, Bool pending); extern _X_EXPORT int RRConfigureProviderProperty(RRProviderPtr provider, Atom property, diff --git a/xorg-server/randr/rrcrtc.c b/xorg-server/randr/rrcrtc.c index 18b1389a1..f28f5061a 100644 --- a/xorg-server/randr/rrcrtc.c +++ b/xorg-server/randr/rrcrtc.c @@ -95,7 +95,7 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate) pixman_f_transform_init_identity(&crtc->f_transform); pixman_f_transform_init_identity(&crtc->f_inverse); - if (!AddResource(crtc->id, RRCrtcType, (pointer) crtc)) + if (!AddResource(crtc->id, RRCrtcType, (void *) crtc)) return NULL; /* attach the screen and crtc together */ @@ -655,7 +655,7 @@ RRCrtcDestroy(RRCrtcPtr crtc) } static int -RRCrtcDestroyResource(pointer value, XID pid) +RRCrtcDestroyResource(void *value, XID pid) { RRCrtcPtr crtc = (RRCrtcPtr) value; ScreenPtr pScreen = crtc->pScreen; @@ -1027,7 +1027,7 @@ ProcRRSetCrtcConfig(ClientPtr client) outputIds = (RROutput *) (stuff + 1); for (i = 0; i < numOutputs; i++) { - ret = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i], + ret = dixLookupResourceByType((void **) (outputs + i), outputIds[i], RROutputType, client, DixSetAttrAccess); if (ret != Success) { free(outputs); diff --git a/xorg-server/randr/rrdispatch.c b/xorg-server/randr/rrdispatch.c index f9b26c137..3fbbc7b14 100644 --- a/xorg-server/randr/rrdispatch.c +++ b/xorg-server/randr/rrdispatch.c @@ -83,7 +83,7 @@ ProcRRSelectInput(ClientPtr client) rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess); if (rc != Success) return rc; - rc = dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + rc = dixLookupResourceByType((void **) &pHead, pWin->drawable.id, RREventType, client, DixWriteAccess); if (rc != Success && rc != BadValue) return rc; @@ -120,7 +120,7 @@ ProcRRSelectInput(ClientPtr client) */ clientResource = FakeClientID(client->index); pRREvent->clientResource = clientResource; - if (!AddResource(clientResource, RRClientType, (pointer) pRREvent)) + if (!AddResource(clientResource, RRClientType, (void *) pRREvent)) return BadAlloc; /* * create a resource to contain a pointer to the list @@ -132,7 +132,7 @@ ProcRRSelectInput(ClientPtr client) pHead = (RREventPtr *) malloc(sizeof(RREventPtr)); if (!pHead || !AddResource(pWin->drawable.id, RREventType, - (pointer) pHead)) { + (void *) pHead)) { FreeResource(clientResource, RT_NONE); return BadAlloc; } diff --git a/xorg-server/randr/rrmode.c b/xorg-server/randr/rrmode.c index c0fa709a0..1145b98e3 100644 --- a/xorg-server/randr/rrmode.c +++ b/xorg-server/randr/rrmode.c @@ -89,7 +89,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen) } mode->mode.id = FakeClientID(0); - if (!AddResource(mode->mode.id, RRModeType, (pointer) mode)) { + if (!AddResource(mode->mode.id, RRModeType, (void *) mode)) { free(newModes); return NULL; } @@ -250,7 +250,7 @@ RRModeDestroy(RRModePtr mode) } static int -RRModeDestroyResource(pointer value, XID pid) +RRModeDestroyResource(void *value, XID pid) { RRModeDestroy((RRModePtr) value); return 1; diff --git a/xorg-server/randr/rroutput.c b/xorg-server/randr/rroutput.c index a6d910b3e..13d047b06 100644 --- a/xorg-server/randr/rroutput.c +++ b/xorg-server/randr/rroutput.c @@ -97,7 +97,7 @@ RROutputCreate(ScreenPtr pScreen, output->changed = FALSE; output->devPrivate = devPrivate; - if (!AddResource(output->id, RROutputType, (pointer) output)) + if (!AddResource(output->id, RROutputType, (void *) output)) return NULL; pScrPriv->outputs[pScrPriv->numOutputs++] = output; @@ -338,7 +338,7 @@ RROutputDestroy(RROutputPtr output) } static int -RROutputDestroyResource(pointer value, XID pid) +RROutputDestroyResource(void *value, XID pid) { RROutputPtr output = (RROutputPtr) value; ScreenPtr pScreen = output->pScreen; diff --git a/xorg-server/randr/rrproperty.c b/xorg-server/randr/rrproperty.c index dcc640e29..dc26115bb 100644 --- a/xorg-server/randr/rrproperty.c +++ b/xorg-server/randr/rrproperty.c @@ -30,7 +30,7 @@ DeliverPropertyEvent(WindowPtr pWin, void *value) xRROutputPropertyNotifyEvent *event = value; RREventPtr *pHead, pRREvent; - dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + dixLookupResourceByType((void **) &pHead, pWin->drawable.id, RREventType, serverClient, DixReadAccess); if (!pHead) return WT_WALKCHILDREN; @@ -134,7 +134,7 @@ RRDeleteOutputProperty(RROutputPtr output, Atom property) int RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent, Bool pending) + void *value, Bool sendevent, Bool pending) { RRPropertyPtr prop; rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen); @@ -177,10 +177,10 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, total_len = prop_value->size + len; if (mode == PropModeReplace || len > 0) { - pointer new_data = NULL, old_data = NULL; + void *new_data = NULL, *old_data = NULL; total_size = total_len * size_in_bytes; - new_value.data = (pointer) malloc(total_size); + new_value.data = (void *) malloc(total_size); if (!new_value.data && total_size) { if (add) RRDestroyOutputProperty(prop); @@ -196,13 +196,13 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, old_data = NULL; break; case PropModeAppend: - new_data = (pointer) (((char *) new_value.data) + + new_data = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); old_data = new_value.data; break; case PropModePrepend: new_data = new_value.data; - old_data = (pointer) (((char *) new_value.data) + + old_data = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); break; } @@ -535,7 +535,7 @@ ProcRRChangeOutputProperty(ClientPtr client) err = RRChangeOutputProperty(output, stuff->property, stuff->type, (int) format, - (int) mode, len, (pointer) &stuff[1], TRUE, + (int) mode, len, (void *) &stuff[1], TRUE, TRUE); if (err != Success) return err; diff --git a/xorg-server/randr/rrprovider.c b/xorg-server/randr/rrprovider.c index a18c72259..66527542e 100644 --- a/xorg-server/randr/rrprovider.c +++ b/xorg-server/randr/rrprovider.c @@ -365,7 +365,7 @@ RRProviderCreate(ScreenPtr pScreen, const char *name, provider->name[nameLength] = '\0'; provider->changed = FALSE; - if (!AddResource (provider->id, RRProviderType, (pointer) provider)) + if (!AddResource (provider->id, RRProviderType, (void *) provider)) return NULL; pScrPriv->provider = provider; return provider; @@ -387,7 +387,7 @@ RRProviderSetCapabilities(RRProviderPtr provider, uint32_t capabilities) } static int -RRProviderDestroyResource (pointer value, XID pid) +RRProviderDestroyResource (void *value, XID pid) { RRProviderPtr provider = (RRProviderPtr)value; ScreenPtr pScreen = provider->pScreen; diff --git a/xorg-server/randr/rrproviderproperty.c b/xorg-server/randr/rrproviderproperty.c index be54f259e..7955423e5 100644 --- a/xorg-server/randr/rrproviderproperty.c +++ b/xorg-server/randr/rrproviderproperty.c @@ -30,7 +30,7 @@ DeliverPropertyEvent(WindowPtr pWin, void *value) xRRProviderPropertyNotifyEvent *event = value; RREventPtr *pHead, pRREvent; - dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + dixLookupResourceByType((void **) &pHead, pWin->drawable.id, RREventType, serverClient, DixReadAccess); if (!pHead) return WT_WALKCHILDREN; @@ -135,7 +135,7 @@ RRDeleteProviderProperty(RRProviderPtr provider, Atom property) int RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent, Bool pending) + void *value, Bool sendevent, Bool pending) { RRPropertyPtr prop; rrScrPrivPtr pScrPriv = rrGetScrPriv(provider->pScreen); @@ -178,10 +178,10 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, total_len = prop_value->size + len; if (mode == PropModeReplace || len > 0) { - pointer new_data = NULL, old_data = NULL; + void *new_data = NULL, *old_data = NULL; total_size = total_len * size_in_bytes; - new_value.data = (pointer) malloc(total_size); + new_value.data = (void *) malloc(total_size); if (!new_value.data && total_size) { if (add) RRDestroyProviderProperty(prop); @@ -197,13 +197,13 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, old_data = NULL; break; case PropModeAppend: - new_data = (pointer) (((char *) new_value.data) + + new_data = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); old_data = new_value.data; break; case PropModePrepend: new_data = new_value.data; - old_data = (pointer) (((char *) new_value.data) + + old_data = (void *) (((char *) new_value.data) + (prop_value->size * size_in_bytes)); break; } @@ -534,7 +534,7 @@ ProcRRChangeProviderProperty(ClientPtr client) err = RRChangeProviderProperty(provider, stuff->property, stuff->type, (int) format, - (int) mode, len, (pointer) &stuff[1], TRUE, + (int) mode, len, (void *) &stuff[1], TRUE, TRUE); if (err != Success) return err; diff --git a/xorg-server/record/record.c b/xorg-server/record/record.c index 7a37ec06a..13529b06f 100644 --- a/xorg-server/record/record.c +++ b/xorg-server/record/record.c @@ -130,15 +130,14 @@ static int numEnabledRCAPs; * returns an error. */ #define VERIFY_CONTEXT(_pContext, _contextid, _client) { \ - int rc = dixLookupResourceByType((pointer *)&(_pContext), _contextid, \ + int rc = dixLookupResourceByType((void **)&(_pContext), _contextid, \ RTContext, _client, DixUseAccess); \ if (rc != Success) \ return rc; \ } -static int RecordDeleteContext(pointer /*value */ , - XID /*id */ - ); +static int RecordDeleteContext(void *value, + XID id); /***************************************************************************/ @@ -232,7 +231,7 @@ RecordFindContextOnAllContexts(RecordContextPtr pContext) */ static void RecordFlushReplyBuffer(RecordContextPtr pContext, - pointer data1, int len1, pointer data2, int len2) + void *data1, int len1, void *data2, int len2) { if (!pContext->pRecordingClient || pContext->pRecordingClient->clientGone || pContext->inFlush) @@ -279,7 +278,7 @@ RecordFlushReplyBuffer(RecordContextPtr pContext, */ static void RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, - int category, pointer data, int datalen, int padlen, + int category, void *data, int datalen, int padlen, int futurelen) { CARD32 elemHeaderData[2]; @@ -390,8 +389,8 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, } } else { - RecordFlushReplyBuffer(pContext, (pointer) elemHeaderData, - numElemHeaders, (pointer) data, + RecordFlushReplyBuffer(pContext, (void *) elemHeaderData, + numElemHeaders, (void *) data, datalen - padlen); } } /* RecordAProtocolElement */ @@ -463,20 +462,20 @@ RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq * stuff) /* record the request header */ bytesLeft = client->req_len << 2; RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer) stuff, SIZEOF(xReq), 0, bytesLeft); + (void *) stuff, SIZEOF(xReq), 0, bytesLeft); /* reinsert the extended length field that was squished out */ bigLength = client->req_len + bytes_to_int32(sizeof(bigLength)); if (client->swapped) swapl(&bigLength); RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer) &bigLength, sizeof(bigLength), 0, + (void *) &bigLength, sizeof(bigLength), 0, /* continuation */ -1); bytesLeft -= sizeof(bigLength); /* record the rest of the request after the length */ RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer) (stuff + 1), bytesLeft, 0, + (void *) (stuff + 1), bytesLeft, 0, /* continuation */ -1); } /* RecordABigRequest */ @@ -520,7 +519,7 @@ RecordARequest(ClientPtr client) RecordABigRequest(pContext, client, stuff); else RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer) stuff, + (void *) stuff, client->req_len << 2, 0, 0); } else { /* extension, check minor opcode */ @@ -543,7 +542,7 @@ RecordARequest(ClientPtr client) else RecordAProtocolElement(pContext, client, XRecordFromClient, - (pointer) stuff, + (void *) stuff, client->req_len << 2, 0, 0); break; } @@ -576,7 +575,7 @@ RecordARequest(ClientPtr client) * chunk of data belonging to this reply, it is set to 0. */ static void -RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) +RecordAReply(CallbackListPtr *pcbl, void *nulldata, void *calldata) { RecordContextPtr pContext; RecordClientsAndProtocolPtr pRCAP; @@ -592,7 +591,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) if (pContext->continuedReply) { RecordAProtocolElement(pContext, client, XRecordFromServer, - (pointer) pri->replyData, + (void *) pri->replyData, pri->dataLenBytes, pri->padBytes, /* continuation */ -1); if (!pri->bytesRemaining) @@ -602,7 +601,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) RecordIsMemberOfSet(pRCAP->pReplyMajorOpSet, majorop)) { if (majorop <= 127) { /* core reply */ RecordAProtocolElement(pContext, client, XRecordFromServer, - (pointer) pri->replyData, + (void *) pri->replyData, pri->dataLenBytes, 0, pri->bytesRemaining); if (pri->bytesRemaining) @@ -625,7 +624,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) minorop)) { RecordAProtocolElement(pContext, client, XRecordFromServer, - (pointer) pri->replyData, + (void *) pri->replyData, pri->dataLenBytes, 0, pri->bytesRemaining); if (pri->bytesRemaining) @@ -655,8 +654,8 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) * it for this client. */ static void -RecordADeliveredEventOrError(CallbackListPtr *pcbl, pointer nulldata, - pointer calldata) +RecordADeliveredEventOrError(CallbackListPtr *pcbl, void *nulldata, + void *calldata) { EventInfoRec *pei = (EventInfoRec *) calldata; RecordContextPtr pContext; @@ -766,7 +765,7 @@ RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP, * it for this client. */ static void -RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) +RecordADeviceEvent(CallbackListPtr *pcbl, void *nulldata, void *calldata) { DeviceEventInfoRec *pei = (DeviceEventInfoRec *) calldata; RecordContextPtr pContext; @@ -812,7 +811,7 @@ RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) */ static void RecordFlushAllContexts(CallbackListPtr *pcbl, - pointer nulldata, pointer calldata) + void *nulldata, void *calldata) { int eci; /* enabled context index */ RecordContextPtr pContext; @@ -1143,7 +1142,7 @@ RecordSanityCheckClientSpecifiers(ClientPtr client, XID *clientspecs, int i; int clientIndex; int rc; - pointer value; + void *value; for (i = 0; i < nspecs; i++) { if (clientspecs[i] == XRecordCurrentClients || @@ -1879,7 +1878,7 @@ ProcRecordCreateContext(ClientPtr client) return Success; } else { - RecordDeleteContext((pointer) pContext, pContext->id); + RecordDeleteContext((void *) pContext, pContext->id); return BadAlloc; } bailout: @@ -2415,7 +2414,7 @@ ProcRecordDisableContext(ClientPtr client) * it from the ppAllContexts array. */ static int -RecordDeleteContext(pointer value, XID id) +RecordDeleteContext(void *value, XID id) { int i; RecordContextPtr pContext = (RecordContextPtr) value; @@ -2534,7 +2533,7 @@ SProcRecordCreateContext(ClientPtr client) swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); - if ((status = SwapCreateRegister((pointer) stuff)) != Success) + if ((status = SwapCreateRegister((void *) stuff)) != Success) return status; return ProcRecordCreateContext(client); } /* SProcRecordCreateContext */ @@ -2547,7 +2546,7 @@ SProcRecordRegisterClients(ClientPtr client) swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq); - if ((status = SwapCreateRegister((pointer) stuff)) != Success) + if ((status = SwapCreateRegister((void *) stuff)) != Success) return status; return ProcRecordRegisterClients(client); } /* SProcRecordRegisterClients */ @@ -2663,7 +2662,7 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec * pci) SwapConnSetupInfo((char *) pci->setup, (char *) (pConnSetup + prefixsize)); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, - (pointer) pConnSetup, prefixsize + restsize, 0, + (void *) pConnSetup, prefixsize + restsize, 0, 0); free(pConnSetup); } @@ -2672,9 +2671,9 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec * pci) * data in two pieces */ RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, - (pointer) pci->prefix, prefixsize, 0, restsize); + (void *) pci->prefix, prefixsize, 0, restsize); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, - (pointer) pci->setup, restsize, 0, + (void *) pci->setup, restsize, 0, /* continuation */ -1); } } /* RecordConnectionSetupInfo */ @@ -2703,8 +2702,8 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec * pci) */ static void -RecordAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, - pointer calldata) +RecordAClientStateChange(CallbackListPtr *pcbl, void *nulldata, + void *calldata) { NewClientInfoRec *pci = (NewClientInfoRec *) calldata; int i; diff --git a/xorg-server/render/animcur.c b/xorg-server/render/animcur.c index 038c5b9be..69f9f887c 100644 --- a/xorg-server/render/animcur.c +++ b/xorg-server/render/animcur.c @@ -136,7 +136,7 @@ AnimCurCursorLimits(DeviceIntPtr pDev, static void AnimCurScreenBlockHandler(ScreenPtr pScreen, - pointer pTimeout, pointer pReadmask) + void *pTimeout, void *pReadmask) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); DeviceIntPtr dev; diff --git a/xorg-server/render/glyph.c b/xorg-server/render/glyph.c index e1dc66291..ae3812171 100644 --- a/xorg-server/render/glyph.c +++ b/xorg-server/render/glyph.c @@ -97,7 +97,7 @@ GlyphUninit(ScreenPtr pScreen) glyph = globalGlyphs[fdepth].table[i].glyph; if (glyph && glyph != DeletedGlyph) { if (GetGlyphPicture(glyph, pScreen)) { - FreePicture((pointer) GetGlyphPicture(glyph, pScreen), 0); + FreePicture((void *) GetGlyphPicture(glyph, pScreen), 0); SetGlyphPicture(glyph, pScreen, NULL); } (*ps->UnrealizeGlyph) (pScreen, glyph); @@ -237,7 +237,7 @@ FreeGlyphPicture(GlyphPtr glyph) ScreenPtr pScreen = screenInfo.screens[i]; if (GetGlyphPicture(glyph, pScreen)) - FreePicture((pointer) GetGlyphPicture(glyph, pScreen), 0); + FreePicture((void *) GetGlyphPicture(glyph, pScreen), 0); ps = GetPictureScreenIfSet(pScreen); if (ps) @@ -467,7 +467,7 @@ AllocateGlyphSet(int fdepth, PictFormatPtr format) } int -FreeGlyphSet(pointer value, XID gid) +FreeGlyphSet(void *value, XID gid) { GlyphSetPtr glyphSet = (GlyphSetPtr) value; @@ -678,7 +678,7 @@ miGlyphs(CARD8 op, pDst, xSrc + x - xDst, ySrc + y - yDst, 0, 0, x, y, width, height); - FreePicture((pointer) pMask, (XID) 0); + FreePicture((void *) pMask, (XID) 0); (*pScreen->DestroyPixmap) (pMaskPixmap); } } diff --git a/xorg-server/render/glyphstr.h b/xorg-server/render/glyphstr.h index 7d178be01..835c1a74e 100644 --- a/xorg-server/render/glyphstr.h +++ b/xorg-server/render/glyphstr.h @@ -131,7 +131,7 @@ extern _X_EXPORT Bool extern _X_EXPORT GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format); extern _X_EXPORT int - FreeGlyphSet(pointer value, XID gid); + FreeGlyphSet(void *value, XID gid); #define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 1 /* used for api compat */ extern _X_EXPORT PicturePtr diff --git a/xorg-server/render/mipict.c b/xorg-server/render/mipict.c index 421df5aa8..b90ea232e 100644 --- a/xorg-server/render/mipict.c +++ b/xorg-server/render/mipict.c @@ -69,17 +69,17 @@ miDestroyPictureClip(PicturePtr pPicture) } int -miChangePictureClip(PicturePtr pPicture, int type, pointer value, int n) +miChangePictureClip(PicturePtr pPicture, int type, void *value, int n) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); - pointer clientClip; + void *clientClip; int clientClipType; switch (type) { case CT_PIXMAP: /* convert the pixmap to a region */ - clientClip = (pointer) BitmapToRegion(pScreen, (PixmapPtr) value); + clientClip = (void *) BitmapToRegion(pScreen, (PixmapPtr) value); if (!clientClip) return BadAlloc; clientClipType = CT_REGION; @@ -94,7 +94,7 @@ miChangePictureClip(PicturePtr pPicture, int type, pointer value, int n) clientClipType = CT_NONE; break; default: - clientClip = (pointer) RegionFromRects(n, (xRectangle *) value, type); + clientClip = (void *) RegionFromRects(n, (xRectangle *) value, type); if (!clientClip) return BadAlloc; clientClipType = CT_REGION; diff --git a/xorg-server/render/mipict.h b/xorg-server/render/mipict.h index 943622888..a16dd3112 100644 --- a/xorg-server/render/mipict.h +++ b/xorg-server/render/mipict.h @@ -57,7 +57,7 @@ extern _X_EXPORT void miDestroyPictureClip(PicturePtr pPicture); extern _X_EXPORT int - miChangePictureClip(PicturePtr pPicture, int type, pointer value, int n); + miChangePictureClip(PicturePtr pPicture, int type, void *value, int n); extern _X_EXPORT void miChangePicture(PicturePtr pPicture, Mask mask); diff --git a/xorg-server/render/mirect.c b/xorg-server/render/mirect.c index 357d52860..4e76972d1 100644 --- a/xorg-server/render/mirect.c +++ b/xorg-server/render/mirect.c @@ -156,7 +156,7 @@ miCompositeRects(CARD8 op, rects++; } - FreePicture((pointer) pSrc, 0); + FreePicture((void *) pSrc, 0); bail4: FreeScratchGC(pGC); bail3: diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c index 2908b7629..7da93102b 100644 --- a/xorg-server/render/picture.c +++ b/xorg-server/render/picture.c @@ -70,7 +70,7 @@ PictureDestroyWindow(WindowPtr pWindow) SetPictureWindow(pWindow, pPicture->pNext); if (pPicture->id) FreeResource(pPicture->id, PictureType); - FreePicture((pointer) pPicture, pPicture->id); + FreePicture((void *) pPicture, pPicture->id); } pScreen->DestroyWindow = ps->DestroyWindow; ret = (*pScreen->DestroyWindow) (pWindow); @@ -445,7 +445,7 @@ PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format) return TRUE; if (format->index.vid == pScreen->rootVisual) { - dixLookupResourceByType((pointer *) &format->index.pColormap, + dixLookupResourceByType((void **) &format->index.pColormap, pScreen->defColormap, RT_COLORMAP, serverClient, DixGetAttrAccess); } @@ -601,7 +601,7 @@ PictureParseCmapPolicy(const char *name) /** @see GetDefaultBytes */ static void -GetPictureBytes(pointer value, XID id, ResourceSizePtr size) +GetPictureBytes(void *value, XID id, ResourceSizePtr size) { PicturePtr picture = value; @@ -655,7 +655,7 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) } for (n = 0; n < nformats; n++) { if (!AddResource - (formats[n].id, PictFormatType, (pointer) (formats + n))) { + (formats[n].id, PictFormatType, (void *) (formats + n))) { free(formats); return FALSE; } @@ -1054,7 +1054,7 @@ ChangePicture(PicturePtr pPicture, if (pid == None) pAlpha = 0; else { - error = dixLookupResourceByType((pointer *) &pAlpha, pid, + error = dixLookupResourceByType((void **) &pAlpha, pid, PictureType, client, DixReadAccess); if (error != Success) { @@ -1075,7 +1075,7 @@ ChangePicture(PicturePtr pPicture, if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) pAlpha->refcnt++; if (pPicture->alphaMap) - FreePicture((pointer) pPicture->alphaMap, (XID) 0); + FreePicture((void *) pPicture->alphaMap, (XID) 0); pPicture->alphaMap = pAlpha; } } @@ -1113,7 +1113,7 @@ ChangePicture(PicturePtr pPicture, } else { clipType = CT_PIXMAP; - error = dixLookupResourceByType((pointer *) &pPixmap, pid, + error = dixLookupResourceByType((void **) &pPixmap, pid, RT_PIXMAP, client, DixReadAccess); if (error != Success) { @@ -1143,7 +1143,7 @@ ChangePicture(PicturePtr pPicture, } } error = (*ps->ChangePictureClip) (pPicture, clipType, - (pointer) pPixmap, 0); + (void *) pPixmap, 0); break; } case CPGraphicsExposure: @@ -1240,7 +1240,7 @@ SetPictureClipRects(PicturePtr pPicture, if (!clientClip) return BadAlloc; result = (*ps->ChangePictureClip) (pPicture, CT_REGION, - (pointer) clientClip, 0); + (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; pPicture->clipOrigin.y = yOrigin; @@ -1276,7 +1276,7 @@ SetPictureClipRegion(PicturePtr pPicture, clientClip = 0; } - result = (*ps->ChangePictureClip) (pPicture, type, (pointer) clientClip, 0); + result = (*ps->ChangePictureClip) (pPicture, type, (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; pPicture->clipOrigin.y = yOrigin; @@ -1354,7 +1354,7 @@ CopyPicture(PicturePtr pSrc, Mask mask, PicturePtr pDst) pSrc->alphaMap->pDrawable->type == DRAWABLE_PIXMAP) pSrc->alphaMap->refcnt++; if (pDst->alphaMap) - FreePicture((pointer) pDst->alphaMap, (XID) 0); + FreePicture((void *) pDst->alphaMap, (XID) 0); pDst->alphaMap = pSrc->alphaMap; break; case CPAlphaXOrigin: @@ -1435,7 +1435,7 @@ ValidatePicture(PicturePtr pPicture) } int -FreePicture(pointer value, XID pid) +FreePicture(void *value, XID pid) { PicturePtr pPicture = (PicturePtr) value; @@ -1454,7 +1454,7 @@ FreePicture(pointer value, XID pid) PictureScreenPtr ps = GetPictureScreen(pScreen); if (pPicture->alphaMap) - FreePicture((pointer) pPicture->alphaMap, (XID) 0); + FreePicture((void *) pPicture->alphaMap, (XID) 0); (*ps->DestroyPicture) (pPicture); (*ps->DestroyPictureClip) (pPicture); if (pPicture->pDrawable->type == DRAWABLE_WINDOW) { @@ -1480,7 +1480,7 @@ FreePicture(pointer value, XID pid) } int -FreePictFormat(pointer pPictFormat, XID pid) +FreePictFormat(void *pPictFormat, XID pid) { return Success; } diff --git a/xorg-server/render/picturestr.h b/xorg-server/render/picturestr.h index 5644f28cf..8c8100d81 100644 --- a/xorg-server/render/picturestr.h +++ b/xorg-server/render/picturestr.h @@ -145,7 +145,7 @@ typedef struct _Picture { DDXPointRec alphaOrigin; DDXPointRec clipOrigin; - pointer clientClip; + void *clientClip; unsigned long serialNumber; @@ -189,7 +189,7 @@ typedef struct { typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, - int clipType, pointer value, int n); + int clipType, void *value, int n); typedef void (*DestroyPictureClipProcPtr) (PicturePtr pPicture); typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture, @@ -363,7 +363,7 @@ extern _X_EXPORT RESTYPE GlyphSetType; #define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p) #define VERIFY_PICTURE(pPicture, pid, client, mode) {\ - int tmprc = dixLookupResourceByType((pointer)&(pPicture), pid,\ + int tmprc = dixLookupResourceByType((void *)&(pPicture), pid,\ PictureType, client, mode);\ if (tmprc != Success)\ return tmprc;\ @@ -482,10 +482,10 @@ extern _X_EXPORT void ValidatePicture(PicturePtr pPicture); extern _X_EXPORT int - FreePicture(pointer pPicture, XID pid); + FreePicture(void *pPicture, XID pid); extern _X_EXPORT int - FreePictFormat(pointer pPictFormat, XID pid); + FreePictFormat(void *pPictFormat, XID pid); extern _X_EXPORT void diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c index b159021e2..7692ed68b 100644 --- a/xorg-server/render/render.c +++ b/xorg-server/render/render.c @@ -220,7 +220,7 @@ typedef struct _RenderClient { #define GetRenderClient(pClient) ((RenderClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RenderClientPrivateKey)) static void -RenderClientCallback(CallbackListPtr *list, pointer closure, pointer data) +RenderClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -520,7 +520,7 @@ ProcRenderQueryPictIndexValues(ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - rc = dixLookupResourceByType((pointer *) &pFormat, stuff->format, + rc = dixLookupResourceByType((void **) &pFormat, stuff->format, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; @@ -587,7 +587,7 @@ ProcRenderCreatePicture(ClientPtr client) if (rc != Success) return rc; - rc = dixLookupResourceByType((pointer *) &pFormat, stuff->format, + rc = dixLookupResourceByType((void **) &pFormat, stuff->format, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; @@ -604,7 +604,7 @@ ProcRenderCreatePicture(ClientPtr client) stuff->mask, (XID *) (stuff + 1), client, &error); if (!pPicture) return error; - if (!AddResource(stuff->pid, PictureType, (pointer) pPicture)) + if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } @@ -744,7 +744,7 @@ ProcRenderTrapezoids(ClientPtr client) if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { - rc = dixLookupResourceByType((pointer *) &pFormat, stuff->maskFormat, + rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; @@ -783,7 +783,7 @@ ProcRenderTriangles(ClientPtr client) if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { - rc = dixLookupResourceByType((pointer *) &pFormat, stuff->maskFormat, + rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; @@ -822,7 +822,7 @@ ProcRenderTriStrip(ClientPtr client) if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { - rc = dixLookupResourceByType((pointer *) &pFormat, stuff->maskFormat, + rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; @@ -861,7 +861,7 @@ ProcRenderTriFan(ClientPtr client) if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { - rc = dixLookupResourceByType((pointer *) &pFormat, stuff->maskFormat, + rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; @@ -909,7 +909,7 @@ ProcRenderCreateGlyphSet(ClientPtr client) REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); LEGAL_NEW_RESOURCE(stuff->gsid, client); - rc = dixLookupResourceByType((pointer *) &format, stuff->format, + rc = dixLookupResourceByType((void **) &format, stuff->format, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; @@ -943,7 +943,7 @@ ProcRenderCreateGlyphSet(ClientPtr client) glyphSet, RT_NONE, NULL, DixCreateAccess); if (rc != Success) return rc; - if (!AddResource(stuff->gsid, GlyphSetType, (pointer) glyphSet)) + if (!AddResource(stuff->gsid, GlyphSetType, (void *) glyphSet)) return BadAlloc; return Success; } @@ -960,14 +960,14 @@ ProcRenderReferenceGlyphSet(ClientPtr client) LEGAL_NEW_RESOURCE(stuff->gsid, client); - rc = dixLookupResourceByType((pointer *) &glyphSet, stuff->existing, + rc = dixLookupResourceByType((void **) &glyphSet, stuff->existing, GlyphSetType, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->existing; return rc; } glyphSet->refcnt++; - if (!AddResource(stuff->gsid, GlyphSetType, (pointer) glyphSet)) + if (!AddResource(stuff->gsid, GlyphSetType, (void *) glyphSet)) return BadAlloc; return Success; } @@ -984,7 +984,7 @@ ProcRenderFreeGlyphSet(ClientPtr client) REQUEST(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - rc = dixLookupResourceByType((pointer *) &glyphSet, stuff->glyphset, + rc = dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixDestroyAccess); if (rc != Success) { client->errorValue = stuff->glyphset; @@ -1024,7 +1024,7 @@ ProcRenderAddGlyphs(ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); err = - dixLookupResourceByType((pointer *) &glyphSet, stuff->glyphset, + dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixAddAccess); if (err != Success) { client->errorValue = stuff->glyphset; @@ -1157,7 +1157,7 @@ ProcRenderAddGlyphs(ClientPtr client) pSrc, None, pDst, 0, 0, 0, 0, 0, 0, width, height); - FreePicture((pointer) pSrc, 0); + FreePicture((void *) pSrc, 0); pSrc = NULL; FreeScratchPixmapHeader(pSrcPix); pSrcPix = NULL; @@ -1189,7 +1189,7 @@ ProcRenderAddGlyphs(ClientPtr client) return Success; bail: if (pSrc) - FreePicture((pointer) pSrc, 0); + FreePicture((void *) pSrc, 0); if (pSrcPix) FreeScratchPixmapHeader(pSrcPix); for (i = 0; i < nglyphs; i++) @@ -1216,7 +1216,7 @@ ProcRenderFreeGlyphs(ClientPtr client) CARD32 glyph; REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - rc = dixLookupResourceByType((pointer *) &glyphSet, stuff->glyphset, + rc = dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixRemoveAccess); if (rc != Success) { client->errorValue = stuff->glyphset; @@ -1282,7 +1282,7 @@ ProcRenderCompositeGlyphs(ClientPtr client) if (pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) return BadMatch; if (stuff->maskFormat) { - rc = dixLookupResourceByType((pointer *) &pFormat, stuff->maskFormat, + rc = dixLookupResourceByType((void **) &pFormat, stuff->maskFormat, PictFormatType, client, DixReadAccess); if (rc != Success) return rc; @@ -1290,7 +1290,7 @@ ProcRenderCompositeGlyphs(ClientPtr client) else pFormat = 0; - rc = dixLookupResourceByType((pointer *) &glyphSet, stuff->glyphset, + rc = dixLookupResourceByType((void **) &glyphSet, stuff->glyphset, GlyphSetType, client, DixUseAccess); if (rc != Success) return rc; @@ -1341,7 +1341,7 @@ ProcRenderCompositeGlyphs(ClientPtr client) if (elt->len == 0xff) { if (buffer + sizeof(GlyphSet) < end) { memcpy(&gs, buffer, sizeof(GlyphSet)); - rc = dixLookupResourceByType((pointer *) &glyphSet, gs, + rc = dixLookupResourceByType((void **) &glyphSet, gs, GlyphSetType, client, DixUseAccess); if (rc != Success) @@ -1508,7 +1508,7 @@ ProcRenderCreateCursor(ClientPtr client) if (pSrc->format == PICT_a8r8g8b8) { (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); + 0xffffffff, (void *) argbbits); } else { PixmapPtr pPixmap; @@ -1544,7 +1544,7 @@ ProcRenderCreateCursor(ClientPtr client) pSrc, 0, pPicture, 0, 0, 0, 0, 0, 0, width, height); (*pScreen->GetImage) (pPicture->pDrawable, 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); + 0xffffffff, (void *) argbbits); FreePicture(pPicture, 0); } /* @@ -1633,7 +1633,7 @@ ProcRenderCreateCursor(ClientPtr client) &pCursor, client, stuff->cid); if (rc != Success) goto bail; - if (!AddResource(stuff->cid, RT_CURSOR, (pointer) pCursor)) { + if (!AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) { rc = BadAlloc; goto bail; } @@ -1799,7 +1799,7 @@ ProcRenderCreateAnimCursor(ClientPtr client) deltas = (CARD32 *) (cursors + ncursor); elt = (xAnimCursorElt *) (stuff + 1); for (i = 0; i < ncursor; i++) { - ret = dixLookupResourceByType((pointer *) (cursors + i), elt->cursor, + ret = dixLookupResourceByType((void **) (cursors + i), elt->cursor, RT_CURSOR, client, DixReadAccess); if (ret != Success) { free(cursors); @@ -1814,7 +1814,7 @@ ProcRenderCreateAnimCursor(ClientPtr client) if (ret != Success) return ret; - if (AddResource(stuff->cid, RT_CURSOR, (pointer) pCursor)) + if (AddResource(stuff->cid, RT_CURSOR, (void *) pCursor)) return Success; return BadAlloc; } @@ -1861,7 +1861,7 @@ ProcRenderCreateSolidFill(ClientPtr client) pPicture, RT_NONE, NULL, DixCreateAccess); if (error != Success) return error; - if (!AddResource(stuff->pid, PictureType, (pointer) pPicture)) + if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } @@ -1900,7 +1900,7 @@ ProcRenderCreateLinearGradient(ClientPtr client) pPicture, RT_NONE, NULL, DixCreateAccess); if (error != Success) return error; - if (!AddResource(stuff->pid, PictureType, (pointer) pPicture)) + if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } @@ -1938,7 +1938,7 @@ ProcRenderCreateRadialGradient(ClientPtr client) pPicture, RT_NONE, NULL, DixCreateAccess); if (error != Success) return error; - if (!AddResource(stuff->pid, PictureType, (pointer) pPicture)) + if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } @@ -1975,7 +1975,7 @@ ProcRenderCreateConicalGradient(ClientPtr client) pPicture, RT_NONE, NULL, DixCreateAccess); if (error != Success) return error; - if (!AddResource(stuff->pid, PictureType, (pointer) pPicture)) + if (!AddResource(stuff->pid, PictureType, (void *) pPicture)) return BadAlloc; return Success; } @@ -2566,7 +2566,7 @@ SProcRenderDispatch(ClientPtr client) #ifdef PANORAMIX #define VERIFY_XIN_PICTURE(pPicture, pid, client, mode) {\ - int rc = dixLookupResourceByType((pointer *)&(pPicture), pid,\ + int rc = dixLookupResourceByType((void **)&(pPicture), pid,\ XRT_PICTURE, client, mode);\ if (rc != Success)\ return rc;\ @@ -2590,7 +2590,7 @@ PanoramiXRenderCreatePicture(ClientPtr client) int result, j; REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - result = dixLookupResourceByClass((pointer *) &refDraw, stuff->drawable, + result = dixLookupResourceByClass((void **) &refDraw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (result != Success) return (result == BadValue) ? BadDrawable : result; diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c index df20f8235..aaa7a69d3 100644 --- a/xorg-server/test/input.c +++ b/xorg-server/test/input.c @@ -1101,7 +1101,7 @@ xi_unregister_handlers(void) static void cmp_attr_fields(InputAttributes * attr1, InputAttributes * attr2) { - char **tags1, **tags2; + const char **tags1, **tags2; assert(attr1 && attr2); assert(attr1 != attr2); @@ -1182,7 +1182,7 @@ dix_input_attributes(void) { InputAttributes orig = { 0 }; InputAttributes *new; - char *tags[4] = { "tag1", "tag2", "tag2", NULL }; + const char *tags[4] = { "tag1", "tag2", "tag2", NULL }; new = DuplicateInputAttributes(NULL); assert(!new); diff --git a/xorg-server/test/signal-logging.c b/xorg-server/test/signal-logging.c index a03c5acbe..7bbd9105e 100644 --- a/xorg-server/test/signal-logging.c +++ b/xorg-server/test/signal-logging.c @@ -56,7 +56,7 @@ check_signed_number_format_test(long int number) FormatInt64(number, string); if(strncmp(string, expected, 21) != 0) { fprintf(stderr, "Failed to convert %jd to decimal string (expected %s but got %s)\n", - number, expected, string); + (intmax_t) number, expected, string); return FALSE; } @@ -93,7 +93,7 @@ check_number_format_test(long unsigned int number) FormatUInt64(number, string); if(strncmp(string, expected, 21) != 0) { fprintf(stderr, "Failed to convert %ju to decimal string (%s vs %s)\n", - number, expected, string); + (intmax_t) number, expected, string); return FALSE; } @@ -101,7 +101,7 @@ check_number_format_test(long unsigned int number) FormatUInt64Hex(number, string); if(strncmp(string, expected, 17) != 0) { fprintf(stderr, "Failed to convert %ju to hexadecimal string (%s vs %s)\n", - number, expected, string); + (intmax_t) number, expected, string); return FALSE; } diff --git a/xorg-server/test/xfree86.c b/xorg-server/test/xfree86.c index f9892e68e..a98671183 100644 --- a/xorg-server/test/xfree86.c +++ b/xorg-server/test/xfree86.c @@ -73,7 +73,8 @@ xfree86_option_list_duplicate(void) static void xfree86_add_comment(void) { - char *current = NULL, *comment; + char *current = NULL; + const char *comment; char compare[1024] = { 0 }; comment = "# foo"; diff --git a/xorg-server/test/xi2/protocol-common.c b/xorg-server/test/xi2/protocol-common.c index e2b0b8ba3..e171115d3 100644 --- a/xorg-server/test/xi2/protocol-common.c +++ b/xorg-server/test/xi2/protocol-common.c @@ -43,9 +43,6 @@ static ClientRec server_client; void *userdata; -extern int CorePointerProc(DeviceIntPtr pDev, int what); -extern int CoreKeyboardProc(DeviceIntPtr pDev, int what); - static void fake_init_sprite(DeviceIntPtr dev) { @@ -254,7 +251,7 @@ init_simple(void) init_window(&window, &root, CLIENT_WINDOW_ID); serverClient = &server_client; - InitClient(serverClient, 0, (pointer) NULL); + InitClient(serverClient, 0, (void *) NULL); if (!InitClientResources(serverClient)) /* for root resources */ FatalError("couldn't init server resources"); SyncExtensionInit(); diff --git a/xorg-server/test/xi2/protocol-common.h b/xorg-server/test/xi2/protocol-common.h index f27f248c6..d30306886 100644 --- a/xorg-server/test/xi2/protocol-common.h +++ b/xorg-server/test/xi2/protocol-common.h @@ -148,7 +148,7 @@ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access); int __real_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access); -Bool __wrap_AddResource(XID id, RESTYPE type, pointer value); +Bool __wrap_AddResource(XID id, RESTYPE type, void *value); int __wrap_dixLookupClient(ClientPtr *c, XID id, ClientPtr client, Mask access); int __real_dixLookupClient(ClientPtr *c, XID id, ClientPtr client, Mask access); diff --git a/xorg-server/test/xi2/protocol-xigetselectedevents.c b/xorg-server/test/xi2/protocol-xigetselectedevents.c index fc33aa554..bedc217b1 100644 --- a/xorg-server/test/xi2/protocol-xigetselectedevents.c +++ b/xorg-server/test/xi2/protocol-xigetselectedevents.c @@ -82,7 +82,7 @@ __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) /* AddResource is called from XISetSEventMask, we don't need this */ Bool -__wrap_AddResource(XID id, RESTYPE type, pointer value) +__wrap_AddResource(XID id, RESTYPE type, void *value) { return TRUE; } diff --git a/xorg-server/test/xtest.c b/xorg-server/test/xtest.c index e5e5241b7..e9fabfbb9 100644 --- a/xorg-server/test/xtest.c +++ b/xorg-server/test/xtest.c @@ -71,7 +71,7 @@ xtest_init_devices(void) screen.DeviceCursorCleanup = device_cursor_cleanup; dixResetPrivates(); serverClient = &server_client; - InitClient(serverClient, 0, (pointer) NULL); + InitClient(serverClient, 0, (void *) NULL); if (!InitClientResources(serverClient)) /* for root resources */ FatalError("couldn't init server resources"); InitAtoms(); diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c index 1ad7519ec..0db6b4ab1 100644 --- a/xorg-server/xfixes/cursor.c +++ b/xorg-server/xfixes/cursor.c @@ -74,7 +74,7 @@ static void deleteCursorHideCountsForScreen(ScreenPtr pScreen); #define VERIFY_CURSOR(pCursor, cursor, client, access) \ do { \ int err; \ - err = dixLookupResourceByType((pointer *) &pCursor, cursor, \ + err = dixLookupResourceByType((void **) &pCursor, cursor, \ RT_CURSOR, client, access); \ if (err != Success) { \ client->errorValue = cursor; \ @@ -196,7 +196,7 @@ static int XFixesSelectCursorInput(ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask) { CursorEventPtr *prev, e; - pointer val; + void *val; int rc; for (prev = &cursorEvents; (e = *prev); prev = &e->next) { @@ -229,12 +229,12 @@ XFixesSelectCursorInput(ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask) DixGetAttrAccess); if (rc != Success) if (!AddResource(pWindow->drawable.id, CursorWindowType, - (pointer) pWindow)) { + (void *) pWindow)) { free(e); return BadAlloc; } - if (!AddResource(e->clientResource, CursorClientType, (pointer) e)) + if (!AddResource(e->clientResource, CursorClientType, (void *) e)) return BadAlloc; *prev = e; @@ -569,13 +569,13 @@ SProcXFixesGetCursorImageAndName(ClientPtr client) * whether it should be replaced with a reference to pCursor. */ -typedef Bool (*TestCursorFunc) (CursorPtr pOld, pointer closure); +typedef Bool (*TestCursorFunc) (CursorPtr pOld, void *closure); typedef struct { RESTYPE type; TestCursorFunc testCursor; CursorPtr pNew; - pointer closure; + void *closure; } ReplaceCursorLookupRec, *ReplaceCursorLookupPtr; static const RESTYPE CursorRestypes[] = { @@ -585,7 +585,7 @@ static const RESTYPE CursorRestypes[] = { #define NUM_CURSOR_RESTYPES (sizeof (CursorRestypes) / sizeof (CursorRestypes[0])) static Bool -ReplaceCursorLookup(pointer value, XID id, pointer closure) +ReplaceCursorLookup(void *value, XID id, void *closure) { ReplaceCursorLookupPtr rcl = (ReplaceCursorLookupPtr) closure; WindowPtr pWin; @@ -627,7 +627,7 @@ ReplaceCursorLookup(pointer value, XID id, pointer closure) } static void -ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, pointer closure) +ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure) { int clientIndex; int resIndex; @@ -653,7 +653,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, pointer closure) */ LookupClientResourceComplex(clients[clientIndex], rcl.type, - ReplaceCursorLookup, (pointer) &rcl); + ReplaceCursorLookup, (void *) &rcl); } } /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */ @@ -661,7 +661,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, pointer closure) } static Bool -TestForCursor(CursorPtr pCursor, pointer closure) +TestForCursor(CursorPtr pCursor, void *closure) { return (pCursor == (CursorPtr) closure); } @@ -679,7 +679,7 @@ ProcXFixesChangeCursor(ClientPtr client) VERIFY_CURSOR(pDestination, stuff->destination, client, DixWriteAccess | DixSetAttrAccess); - ReplaceCursor(pSource, TestForCursor, (pointer) pDestination); + ReplaceCursor(pSource, TestForCursor, (void *) pDestination); return Success; } @@ -696,7 +696,7 @@ SProcXFixesChangeCursor(ClientPtr client) } static Bool -TestForCursorName(CursorPtr pCursor, pointer closure) +TestForCursorName(CursorPtr pCursor, void *closure) { Atom *pName = closure; @@ -777,7 +777,7 @@ createCursorHideCount(ClientPtr pClient, ScreenPtr pScreen) * Create a resource for this element so it can be deleted * when the client goes away. */ - if (!AddResource(pChc->resource, CursorHideCountType, (pointer) pChc)) { + if (!AddResource(pChc->resource, CursorHideCountType, (void *) pChc)) { free(pChc); return BadAlloc; } @@ -842,7 +842,7 @@ ProcXFixesHideCursor(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesHideCursorReq); - ret = dixLookupResourceByType((pointer *) &pWin, stuff->window, RT_WINDOW, + ret = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixGetAttrAccess); if (ret != Success) { client->errorValue = stuff->window; @@ -906,7 +906,7 @@ ProcXFixesShowCursor(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesShowCursorReq); - rc = dixLookupResourceByType((pointer *) &pWin, stuff->window, RT_WINDOW, + rc = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->window; @@ -947,7 +947,7 @@ SProcXFixesShowCursor(ClientPtr client) } static int -CursorFreeClient(pointer data, XID id) +CursorFreeClient(void *data, XID id) { CursorEventPtr old = (CursorEventPtr) data; CursorEventPtr *prev, e; @@ -963,7 +963,7 @@ CursorFreeClient(pointer data, XID id) } static int -CursorFreeHideCount(pointer data, XID id) +CursorFreeHideCount(void *data, XID id) { CursorHideCountPtr pChc = (CursorHideCountPtr) data; ScreenPtr pScreen = pChc->pScreen; @@ -979,7 +979,7 @@ CursorFreeHideCount(pointer data, XID id) } static int -CursorFreeWindow(pointer data, XID id) +CursorFreeWindow(void *data, XID id) { WindowPtr pWindow = (WindowPtr) data; CursorEventPtr e, next; diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c index 14a02ba1d..cc8f1a5ef 100644 --- a/xorg-server/xfixes/region.c +++ b/xorg-server/xfixes/region.c @@ -35,7 +35,7 @@ RESTYPE RegionResType; static int -RegionResFree(pointer data, XID id) +RegionResFree(void *data, XID id) { RegionPtr pRegion = (RegionPtr) data; @@ -85,7 +85,7 @@ ProcXFixesCreateRegion(ClientPtr client) pRegion = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED); if (!pRegion) return BadAlloc; - if (!AddResource(stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return Success; @@ -115,7 +115,7 @@ ProcXFixesCreateRegionFromBitmap(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesCreateRegionFromBitmapReq); LEGAL_NEW_RESOURCE(stuff->region, client); - rc = dixLookupResourceByType((pointer *) &pPixmap, stuff->bitmap, RT_PIXMAP, + rc = dixLookupResourceByType((void **) &pPixmap, stuff->bitmap, RT_PIXMAP, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->bitmap; @@ -129,7 +129,7 @@ ProcXFixesCreateRegionFromBitmap(ClientPtr client) if (!pRegion) return BadAlloc; - if (!AddResource(stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return Success; @@ -159,7 +159,7 @@ ProcXFixesCreateRegionFromWindow(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesCreateRegionFromWindowReq); LEGAL_NEW_RESOURCE(stuff->region, client); - rc = dixLookupResourceByType((pointer *) &pWin, stuff->window, RT_WINDOW, + rc = dixLookupResourceByType((void **) &pWin, stuff->window, RT_WINDOW, client, DixGetAttrAccess); if (rc != Success) { client->errorValue = stuff->window; @@ -188,7 +188,7 @@ ProcXFixesCreateRegionFromWindow(ClientPtr client) pRegion = XFixesRegionCopy(pRegion); if (!pRegion) return BadAlloc; - if (!AddResource(stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return Success; @@ -238,7 +238,7 @@ ProcXFixesCreateRegionFromGC(ClientPtr client) return BadImplementation; /* assume sane server bits */ } - if (!AddResource(stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return Success; @@ -285,7 +285,7 @@ ProcXFixesCreateRegionFromPicture(ClientPtr client) return BadImplementation; /* assume sane server bits */ } - if (!AddResource(stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource(stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return Success; @@ -629,7 +629,7 @@ ProcXFixesSetGCClipRegion(ClientPtr client) vals[1].val = stuff->yOrigin; ChangeGC(NullClient, pGC, GCClipXOrigin | GCClipYOrigin, vals); (*pGC->funcs->ChangeClip) (pGC, pRegion ? CT_REGION : CT_NONE, - (pointer) pRegion, 0); + (void *) pRegion, 0); return Success; } @@ -661,7 +661,7 @@ ProcXFixesSetWindowShapeRegion(ClientPtr client) REQUEST(xXFixesSetWindowShapeRegionReq); REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq); - rc = dixLookupResourceByType((pointer *) &pWin, stuff->dest, RT_WINDOW, + rc = dixLookupResourceByType((void **) &pWin, stuff->dest, RT_WINDOW, client, DixSetAttrAccess); if (rc != Success) { client->errorValue = stuff->dest; diff --git a/xorg-server/xfixes/select.c b/xorg-server/xfixes/select.c index 17fb0b583..5a6be7d57 100644 --- a/xorg-server/xfixes/select.c +++ b/xorg-server/xfixes/select.c @@ -51,7 +51,7 @@ typedef struct _SelectionEvent { static SelectionEventPtr selectionEvents; static void -XFixesSelectionCallback(CallbackListPtr *callbacks, pointer data, pointer args) +XFixesSelectionCallback(CallbackListPtr *callbacks, void *data, void *args) { SelectionEventPtr e; SelectionInfoRec *info = (SelectionInfoRec *) args; @@ -118,7 +118,7 @@ static int XFixesSelectSelectionInput(ClientPtr pClient, Atom selection, WindowPtr pWindow, CARD32 eventMask) { - pointer val; + void *val; int rc; SelectionEventPtr *prev, e; @@ -158,12 +158,12 @@ XFixesSelectSelectionInput(ClientPtr pClient, DixGetAttrAccess); if (rc != Success) if (!AddResource(pWindow->drawable.id, SelectionWindowType, - (pointer) pWindow)) { + (void *) pWindow)) { free(e); return BadAlloc; } - if (!AddResource(e->clientResource, SelectionClientType, (pointer) e)) + if (!AddResource(e->clientResource, SelectionClientType, (void *) e)) return BadAlloc; *prev = e; @@ -221,7 +221,7 @@ SXFixesSelectionNotifyEvent(xXFixesSelectionNotifyEvent * from, } static int -SelectionFreeClient(pointer data, XID id) +SelectionFreeClient(void *data, XID id) { SelectionEventPtr old = (SelectionEventPtr) data; SelectionEventPtr *prev, e; @@ -238,7 +238,7 @@ SelectionFreeClient(pointer data, XID id) } static int -SelectionFreeWindow(pointer data, XID id) +SelectionFreeWindow(void *data, XID id) { WindowPtr pWindow = (WindowPtr) data; SelectionEventPtr e, next; diff --git a/xorg-server/xfixes/xfixes.c b/xorg-server/xfixes/xfixes.c index c377d233c..a4729f343 100644 --- a/xorg-server/xfixes/xfixes.c +++ b/xorg-server/xfixes/xfixes.c @@ -213,7 +213,7 @@ SProcXFixesDispatch(ClientPtr client) } static void -XFixesClientCallback(CallbackListPtr *list, pointer closure, pointer data) +XFixesClientCallback(CallbackListPtr *list, void *closure, void *data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; diff --git a/xorg-server/xfixes/xfixes.h b/xorg-server/xfixes/xfixes.h index 98828710f..fdcf44f3f 100644 --- a/xorg-server/xfixes/xfixes.h +++ b/xorg-server/xfixes/xfixes.h @@ -35,7 +35,7 @@ extern _X_EXPORT int XFixesErrorBase; #define VERIFY_REGION(pRegion, rid, client, mode) \ do { \ int err; \ - err = dixLookupResourceByType((pointer *) &pRegion, rid, \ + err = dixLookupResourceByType((void **) &pRegion, rid, \ RegionResType, client, mode); \ if (err != Success) { \ client->errorValue = rid; \ diff --git a/xorg-server/xkb/ddxBeep.c b/xorg-server/xkb/ddxBeep.c index f95d0ee81..caf78c94d 100644 --- a/xorg-server/xkb/ddxBeep.c +++ b/xorg-server/xkb/ddxBeep.c @@ -113,7 +113,7 @@ _XkbDDXBeepInitAtoms(void) } static CARD32 -_XkbDDXBeepExpire(OsTimerPtr timer, CARD32 now, pointer arg) +_XkbDDXBeepExpire(OsTimerPtr timer, CARD32 now, void *arg) { DeviceIntPtr dev = (DeviceIntPtr) arg; KbdFeedbackPtr feed; @@ -300,11 +300,11 @@ _XkbDDXBeepExpire(OsTimerPtr timer, CARD32 now, pointer arg) ctrl->bell_duration = duration; ctrl->bell_pitch = pitch; if (xkbInfo->beepCount == 0) { - XkbHandleBell(0, 0, dev, ctrl->bell, (pointer) ctrl, + XkbHandleBell(0, 0, dev, ctrl->bell, (void *) ctrl, KbdFeedbackClass, name, None, NULL); } else if (xkbInfo->desc->ctrls->enabled_ctrls & XkbAudibleBellMask) { - (*dev->kbdfeed->BellProc) (ctrl->bell, dev, (pointer) ctrl, + (*dev->kbdfeed->BellProc) (ctrl->bell, dev, (void *) ctrl, KbdFeedbackClass); } ctrl->bell_duration = oldDuration; @@ -340,11 +340,11 @@ XkbDDXAccessXBeep(DeviceIntPtr dev, unsigned what, unsigned which) xkbInfo->beepType = what; xkbInfo->beepCount = 0; - next = _XkbDDXBeepExpire(NULL, 0, (pointer) dev); + next = _XkbDDXBeepExpire(NULL, 0, (void *) dev); if (next > 0) { xkbInfo->beepTimer = TimerSet(xkbInfo->beepTimer, 0, next, - _XkbDDXBeepExpire, (pointer) dev); + _XkbDDXBeepExpire, (void *) dev); } return 1; } diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c index d462957f4..f458e3bde 100644 --- a/xorg-server/xkb/ddxLoad.c +++ b/xorg-server/xkb/ddxLoad.c @@ -299,7 +299,7 @@ XkbDDXLoadKeymapByNames(DeviceIntPtr keybd, Bool XkbDDXNamesFromRules(DeviceIntPtr keybd, - char *rules_name, + const char *rules_name, XkbRF_VarDefsPtr defs, XkbComponentNamesPtr names) { char buf[PATH_MAX]; diff --git a/xorg-server/xkb/maprules.c b/xorg-server/xkb/maprules.c index 5462763d1..6f5f8ccf3 100644 --- a/xorg-server/xkb/maprules.c +++ b/xorg-server/xkb/maprules.c @@ -218,10 +218,10 @@ typedef struct _FileSpec { } FileSpec; typedef struct { - char *model; - char *layout[XkbNumKbdGroups + 1]; - char *variant[XkbNumKbdGroups + 1]; - char *options; + const char *model; + const char *layout[XkbNumKbdGroups + 1]; + const char *variant[XkbNumKbdGroups + 1]; + const char *options; } XkbRF_MultiDefsRec, *XkbRF_MultiDefsPtr; #define NDX_BUFF_SIZE 4 @@ -343,9 +343,9 @@ SetUpRemap(InputLine * line, RemapSpec * remap) } static Bool -MatchOneOf(char *wanted, char *vals_defined) +MatchOneOf(const char *wanted, const char *vals_defined) { - char *str, *next; + const char *str, *next; int want_len = strlen(wanted); for (str = vals_defined, next = NULL; str != NULL; str = next) { @@ -469,7 +469,7 @@ CheckLine(InputLine * line, } static char * -_Concat(char *str1, char *str2) +_Concat(char *str1, const char *str2) { int len; @@ -498,12 +498,13 @@ squeeze_spaces(char *p1) static Bool MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) { - + char *options; memset((char *) mdefs, 0, sizeof(XkbRF_MultiDefsRec)); mdefs->model = defs->model; - mdefs->options = Xstrdup(defs->options); - if (mdefs->options) - squeeze_spaces(mdefs->options); + options = Xstrdup(defs->options); + if (options) + squeeze_spaces(options); + mdefs->options = options; if (defs->layout) { if (!strchr(defs->layout, ',')) { @@ -511,13 +512,15 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) } else { char *p; + char *layout; int i; - mdefs->layout[1] = Xstrdup(defs->layout); - if (mdefs->layout[1] == NULL) + layout = Xstrdup(defs->layout); + if (layout == NULL) return FALSE; - squeeze_spaces(mdefs->layout[1]); - p = mdefs->layout[1]; + squeeze_spaces(layout); + mdefs->layout[1] = layout; + p = layout; for (i = 2; i <= XkbNumKbdGroups; i++) { if ((p = strchr(p, ','))) { *p++ = '\0'; @@ -538,13 +541,15 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) } else { char *p; + char *variant; int i; - mdefs->variant[1] = Xstrdup(defs->variant); - if (mdefs->variant[1] == NULL) + variant = Xstrdup(defs->variant); + if (variant == NULL) return FALSE; - squeeze_spaces(mdefs->variant[1]); - p = mdefs->variant[1]; + squeeze_spaces(variant); + mdefs->variant[1] = variant; + p = variant; for (i = 2; i <= XkbNumKbdGroups; i++) { if ((p = strchr(p, ','))) { *p++ = '\0'; @@ -564,13 +569,13 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs) static void FreeMultiDefs(XkbRF_MultiDefsPtr defs) { - free(defs->options); - free(defs->layout[1]); - free(defs->variant[1]); + free((void *) defs->options); + free((void *) defs->layout[1]); + free((void *) defs->variant[1]); } static void -Apply(char *src, char **dst) +Apply(const char *src, char **dst) { if (src) { if (*src == '+' || *src == '!') { @@ -596,7 +601,7 @@ XkbRF_ApplyRule(XkbRF_RulePtr rule, XkbComponentNamesPtr names) } static Bool -CheckGroup(XkbRF_RulesPtr rules, char *group_name, char *name) +CheckGroup(XkbRF_RulesPtr rules, const char *group_name, const char *name) { int i; char *p; @@ -1013,15 +1018,15 @@ XkbRF_Free(XkbRF_RulesPtr rules, Bool freeRules) return; if (rules->rules) { for (i = 0, rule = rules->rules; i < rules->num_rules; i++, rule++) { - free(rule->model); - free(rule->layout); - free(rule->variant); - free(rule->option); - free(rule->keycodes); - free(rule->symbols); - free(rule->types); - free(rule->compat); - free(rule->geometry); + free((void *) rule->model); + free((void *) rule->layout); + free((void *) rule->variant); + free((void *) rule->option); + free((void *) rule->keycodes); + free((void *) rule->symbols); + free((void *) rule->types); + free((void *) rule->compat); + free((void *) rule->geometry); memset((char *) rule, 0, sizeof(XkbRF_RuleRec)); } free(rules->rules); @@ -1031,7 +1036,7 @@ XkbRF_Free(XkbRF_RulesPtr rules, Bool freeRules) if (rules->groups) { for (i = 0, group = rules->groups; i < rules->num_groups; i++, group++) { - free(group->name); + free((void *) group->name); free(group->words); } free(rules->groups); diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c index 408775039..5d74aab7f 100644 --- a/xorg-server/xkb/xkb.c +++ b/xorg-server/xkb/xkb.c @@ -369,7 +369,7 @@ _XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin, int percent, int forceSound, int eventOnly, Atom name) { int base; - pointer ctrl; + void *ctrl; int oldPitch, oldDuration; int newPercent; @@ -389,7 +389,7 @@ _XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin, return BadValue; } base = k->ctrl.bell; - ctrl = (pointer) &(k->ctrl); + ctrl = (void *) &(k->ctrl); oldPitch = k->ctrl.bell_pitch; oldDuration = k->ctrl.bell_duration; if (pitch != 0) { @@ -421,7 +421,7 @@ _XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin, return BadValue; } base = b->ctrl.percent; - ctrl = (pointer) &(b->ctrl); + ctrl = (void *) &(b->ctrl); oldPitch = b->ctrl.pitch; oldDuration = b->ctrl.duration; if (pitch != 0) { @@ -4414,7 +4414,7 @@ ProcXkbSetNames(ClientPtr client) * (swapped) 16 bit string length, non-zero terminated. */ static char * -XkbWriteCountedString(char *wire, char *str, Bool swap) +XkbWriteCountedString(char *wire, const char *str, Bool swap) { CARD16 len, *pLen, paddedLen; @@ -6816,7 +6816,7 @@ ProcXkbDispatch(ClientPtr client) } static int -XkbClientGone(pointer data, XID id) +XkbClientGone(void *data, XID id) { DevicePtr pXDev = (DevicePtr) data; diff --git a/xorg-server/xkb/xkbAccessX.c b/xorg-server/xkb/xkbAccessX.c index 13051e034..cb4bca008 100644 --- a/xorg-server/xkb/xkbAccessX.c +++ b/xorg-server/xkb/xkbAccessX.c @@ -279,7 +279,7 @@ AccessXStickyKeysTurnOff(DeviceIntPtr dev, xkbControlsNotify * pCN) } /* AccessXStickyKeysTurnOff */ static CARD32 -AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg) +AccessXKRGExpire(OsTimerPtr timer, CARD32 now, void *arg) { xkbControlsNotify cn; DeviceIntPtr dev = arg; @@ -309,7 +309,7 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg) } static CARD32 -AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg) +AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, void *arg) { DeviceIntPtr dev = (DeviceIntPtr) arg; XkbSrvInfoPtr xkbi = dev->key->xkbInfo; @@ -331,7 +331,7 @@ AccessXCancelRepeatKey(XkbSrvInfoPtr xkbi, KeyCode key) } static CARD32 -AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg) +AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, void *arg) { DeviceIntPtr keybd; XkbSrvInfoPtr xkbi; @@ -370,7 +370,7 @@ AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg) xkbi->repeatKeyTimer = TimerSet(xkbi->repeatKeyTimer, 0, ctrls->repeat_delay, AccessXRepeatKeyExpire, - (pointer) keybd); + (void *) keybd); } } } @@ -378,7 +378,7 @@ AccessXSlowKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg) } static CARD32 -AccessXBounceKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg) +AccessXBounceKeyExpire(OsTimerPtr timer, CARD32 now, void *arg) { XkbSrvInfoPtr xkbi = ((DeviceIntPtr) arg)->key->xkbInfo; @@ -387,7 +387,7 @@ AccessXBounceKeyExpire(OsTimerPtr timer, CARD32 now, pointer arg) } static CARD32 -AccessXTimeoutExpire(OsTimerPtr timer, CARD32 now, pointer arg) +AccessXTimeoutExpire(OsTimerPtr timer, CARD32 now, void *arg) { DeviceIntPtr dev = (DeviceIntPtr) arg; XkbSrvInfoPtr xkbi = dev->key->xkbInfo; @@ -467,12 +467,12 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd) if (XkbAX_NeedFeedback(ctrls, XkbAX_SlowWarnFBMask)) { xkbi->krgTimerActive = _KRG_WARN_TIMER; xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 4000, - AccessXKRGExpire, (pointer) keybd); + AccessXKRGExpire, (void *) keybd); } else { xkbi->krgTimerActive = _KRG_TIMER; xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 8000, - AccessXKRGExpire, (pointer) keybd); + AccessXKRGExpire, (void *) keybd); } if (!(ctrls->enabled_ctrls & XkbSlowKeysMask)) { CARD32 now = GetTimeInMillis(); @@ -514,7 +514,7 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd) xkbi->slowKey = key; xkbi->slowKeysTimer = TimerSet(xkbi->slowKeysTimer, 0, ctrls->slow_keys_delay, - AccessXSlowKeyExpire, (pointer) keybd); + AccessXSlowKeyExpire, (void *) keybd); ignoreKeyEvent = TRUE; } @@ -546,7 +546,7 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd) xkbi->repeatKeyTimer = TimerSet(xkbi->repeatKeyTimer, 0, ctrls->repeat_delay, AccessXRepeatKeyExpire, - (pointer) keybd); + (void *) keybd); } } } @@ -608,7 +608,7 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) xkbi->bounceKeysTimer = TimerSet(xkbi->bounceKeysTimer, 0, ctrls->debounce_delay, AccessXBounceKeyExpire, - (pointer) keybd); + (void *) keybd); } /* Don't transmit the KeyRelease if SlowKeys is turned on and @@ -651,7 +651,7 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) xkbi->lastPtrEventTime = 0; xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, ctrls->ax_timeout * 1000, - AccessXTimeoutExpire, (pointer) keybd); + AccessXTimeoutExpire, (void *) keybd); xkbi->krgTimerActive = _ALL_TIMEOUT_TIMER; } else if (xkbi->krgTimerActive != _OFF_TIMER) { diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c index 09f8e489b..3fbf05183 100644 --- a/xorg-server/xkb/xkbActions.c +++ b/xorg-server/xkb/xkbActions.c @@ -51,7 +51,7 @@ static void XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y); void -xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, pointer data) +xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, void *data) { xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device); ProcessInputProc backupproc; @@ -470,7 +470,7 @@ _XkbFilterISOLock(XkbSrvInfoPtr xkbi, } static CARD32 -_XkbPtrAccelExpire(OsTimerPtr timer, CARD32 now, pointer arg) +_XkbPtrAccelExpire(OsTimerPtr timer, CARD32 now, void *arg) { XkbSrvInfoPtr xkbi = (XkbSrvInfoPtr) arg; XkbControlsPtr ctrls = xkbi->desc->ctrls; @@ -540,7 +540,7 @@ _XkbFilterPointerMove(XkbSrvInfoPtr xkbi, xkbi->mouseKeysDY = XkbPtrActionY(&pAction->ptr); xkbi->mouseKeyTimer = TimerSet(xkbi->mouseKeyTimer, 0, xkbi->desc->ctrls->mk_delay, - _XkbPtrAccelExpire, (pointer) xkbi); + _XkbPtrAccelExpire, (void *) xkbi); } else if (filter->keycode == keycode) { filter->active = 0; diff --git a/xorg-server/xkb/xkbEvents.c b/xorg-server/xkb/xkbEvents.c index 66a6e1509..e2ba38886 100644 --- a/xorg-server/xkb/xkbEvents.c +++ b/xorg-server/xkb/xkbEvents.c @@ -480,7 +480,7 @@ XkbHandleBell(BOOL force, BOOL eventOnly, DeviceIntPtr kbd, CARD8 percent, - pointer pCtrl, + void *pCtrl, CARD8 class, Atom name, WindowPtr pWin, ClientPtr pClient) { xkbBellNotify bn; @@ -500,7 +500,7 @@ XkbHandleBell(BOOL force, if ((force || (xkbi->desc->ctrls->enabled_ctrls & XkbAudibleBellMask)) && (!eventOnly)) { if (kbd->kbdfeed->BellProc) - (*kbd->kbdfeed->BellProc) (percent, kbd, (pointer) pCtrl, class); + (*kbd->kbdfeed->BellProc) (percent, kbd, (void *) pCtrl, class); } interest = kbd->xkb_interest; if ((!interest) || (force)) diff --git a/xorg-server/xkb/xkbInit.c b/xorg-server/xkb/xkbInit.c index b7c521b12..d3bcbc9f2 100644 --- a/xorg-server/xkb/xkbInit.c +++ b/xorg-server/xkb/xkbInit.c @@ -129,11 +129,11 @@ XkbFreeRMLVOSet(XkbRMLVOSet * rmlvo, Bool freeRMLVO) if (!rmlvo) return; - free(rmlvo->rules); - free(rmlvo->model); - free(rmlvo->layout); - free(rmlvo->variant); - free(rmlvo->options); + free((void *) rmlvo->rules); + free((void *) rmlvo->model); + free((void *) rmlvo->layout); + free((void *) rmlvo->variant); + free((void *) rmlvo->options); if (freeRMLVO) free(rmlvo); @@ -142,7 +142,7 @@ XkbFreeRMLVOSet(XkbRMLVOSet * rmlvo, Bool freeRMLVO) } static Bool -XkbWriteRulesProp(ClientPtr client, pointer closure) +XkbWriteRulesProp(ClientPtr client, void *closure) { int len, out; Atom name; diff --git a/xorg-server/xkeyboard-config/compat/README b/xorg-server/xkeyboard-config/compat/README index 00d591e7b..3c5747bb8 100644 --- a/xorg-server/xkeyboard-config/compat/README +++ b/xorg-server/xkeyboard-config/compat/README @@ -1,7 +1,7 @@ The core protocol interpretation of keyboard modifiers does not include direct support for multiple keyboard groups, so XKB reports the effective keyboard -group to XKB-aware clients using some of reserved bits in the state field of -some core protocol events. This modified state field would not be interpreted +group to XKB-aware clients using some of the reserved bits in the state field +of some core protocol events. This modified state field would not be interpreted correctly by XKB-unaware clients, so XKB provides a group compatibility mapping which remaps the keyboard group into a core modifier mask that has similar effects, when possible. @@ -15,8 +15,8 @@ XKB-unaware clients(*) work as well as possible: - The compatibility grab state which is the nearest core-protocol equivalent of the grab state. -Compatibility state are essentially the corresponding XKB states, but with -keyboard group possibly encoded as one or more modifiers. +Compatibility states are essentially the corresponding XKB states, but with +the keyboard group possibly encoded as one or more modifiers. Modifiers that correspond to each keyboard group are described in this group compatibility map. @@ -25,9 +25,9 @@ group compatibility map. ---- (*) The implementation of XKB invisibly extends the X library to use the keyboard extension if it is present. That means, clients that use library or -toolkit routines to interpret keyboard events automatically use all of XKB -features; clients that directly interpret the state field of core protocol -events or the keymap direcly may be affected by some of the XKB differences. +toolkit routines to interpret keyboard events automatically use all of XKB's +features; clients that directly interpret the state field of core-protocol +events or the keymap directly may be affected by some of the XKB differences. Thus most clients can take all advantages without modification but it also means that XKB state can be reported to clients that have not explicitly requested the keyboard extension. diff --git a/xorg-server/xkeyboard-config/compat/accessx b/xorg-server/xkeyboard-config/compat/accessx index 0ed34ced1..6dd6ca930 100644 --- a/xorg-server/xkeyboard-config/compat/accessx +++ b/xorg-server/xkeyboard-config/compat/accessx @@ -1,17 +1,17 @@ default partial xkb_compatibility "basic" { - interpret AccessX_Enable { - action= LockControls(controls=AccessXKeys); + interpret AccessX_Enable { + action= LockControls(controls=AccessXKeys); }; }; partial xkb_compatibility "full" { interpret AccessX_Enable { - action= LockControls(controls=AccessXKeys); + action= LockControls(controls=AccessXKeys); }; - interpret AccessX_Feedback_Enable { - action= LockControls(controls=AccessXFeedback); + interpret AccessX_Feedback_Enable { + action= LockControls(controls=AccessXFeedback); }; interpret RepeatKeys_Enable { diff --git a/xorg-server/xkeyboard-config/compat/basic b/xorg-server/xkeyboard-config/compat/basic index 393c32445..745cbbaed 100644 --- a/xorg-server/xkeyboard-config/compat/basic +++ b/xorg-server/xkeyboard-config/compat/basic @@ -1,10 +1,11 @@ -// Minimal set of symbol interpretations to provide -// reasonable default behavior (Num lock, shift and -// caps lock and mode switch) and set up the +// Minimal set of symbol interpretations to provide +// reasonable default behavior (Num lock, Shift lock, +// Caps lock, and Mode switch) and set up the // automatic updating of common keyboard LEDs. -default xkb_compatibility "basic" { - virtual_modifiers NumLock,AltGr; +default xkb_compatibility "basic" { + + virtual_modifiers NumLock,AltGr; interpret.repeat= False; setMods.clearLocks= True; diff --git a/xorg-server/xkeyboard-config/compat/caps b/xorg-server/xkeyboard-config/compat/caps index d787ab63d..4793051ec 100644 --- a/xorg-server/xkeyboard-config/compat/caps +++ b/xorg-server/xkeyboard-config/compat/caps @@ -1,11 +1,10 @@ -partial xkb_compatibility "caps_lock" { - // Keysym Caps_Lock locks Lock modifier. - // With this, the keysym Caps_Lock can be used without binding the whole - // key to a real modifier. - // This is essential when you don't want to use caps lock on the first - // level. - // This should not have any compatibility issues when used together with - // other layouts which don't utilize this capability. +partial xkb_compatibility "caps_lock" { + // Keysym Caps_Lock locks the Lock modifier. + // With this definition, the keysym Caps_Lock can be used without binding + // the whole key to a real modifier. This is essential when you don't + // want to use Caps_Lock on the first level. + // This should not have any compatibility issues when used together with + // other layouts which don't utilize this capability. interpret Caps_Lock { action = LockMods(modifiers = Lock); }; diff --git a/xorg-server/xkeyboard-config/compat/complete b/xorg-server/xkeyboard-config/compat/complete index d33c4dbce..8f77538db 100644 --- a/xorg-server/xkeyboard-config/compat/complete +++ b/xorg-server/xkeyboard-config/compat/complete @@ -1,4 +1,4 @@ -default xkb_compatibility "complete" { +default xkb_compatibility "complete" { include "basic" augment "iso9995" augment "mousekeys" diff --git a/xorg-server/xkeyboard-config/compat/iso9995 b/xorg-server/xkeyboard-config/compat/iso9995 index 76188d1f0..0f3025b8c 100644 --- a/xorg-server/xkeyboard-config/compat/iso9995 +++ b/xorg-server/xkeyboard-config/compat/iso9995 @@ -1,8 +1,9 @@ -// Fairly complete set of symbol interpretations -// to provide reasonable default behavior +// Fairly complete set of symbol interpretations +// to provide reasonable default behavior. -default partial xkb_compatibility "default" { - virtual_modifiers LevelThree,AltGr; +default partial xkb_compatibility "default" { + + virtual_modifiers LevelThree,AltGr; interpret.repeat= False; setMods.clearLocks= True; diff --git a/xorg-server/xkeyboard-config/compat/japan b/xorg-server/xkeyboard-config/compat/japan index ab4f85e4c..322bbdb14 100644 --- a/xorg-server/xkeyboard-config/compat/japan +++ b/xorg-server/xkeyboard-config/compat/japan @@ -1,11 +1,11 @@ -// Japanese keyboards need Eisu and Kana shift and -// lock keys, which are typically bound to the -// second shift level for some other modifier key. +// Japanese keyboards need the Eisu and Kana Shift +// and Lock keys, which are typically bound to the +// second shift level of some other modifier key. // These interpretations disable the default // interpretation (which would have these keys set -// the same modifier as the level one symbol). +// to the same modifier as the level one symbol). -default partial xkb_compatibility "japan" { +default partial xkb_compatibility "japan" { interpret.repeat= False; @@ -26,16 +26,16 @@ default partial xkb_compatibility "japan" { }; }; -// Some Japanese keyboards have an explict Kana Lock key & matching LED +// Some Japanese keyboards have an explict +// Kana Lock key and matching LED. +partial xkb_compatibility "kana_lock" { -partial xkb_compatibility "kana_lock" { - - virtual_modifiers Kana_Lock; + virtual_modifiers Kana_Lock; interpret Kana_Lock+AnyOfOrNone(all) { - virtualModifier= Kana_Lock; - useModMapMods=level1; - action= LockGroup(group=+1); + virtualModifier= Kana_Lock; + useModMapMods=level1; + action= LockGroup(group=+1); }; indicator "Kana" { diff --git a/xorg-server/xkeyboard-config/compat/ledcaps b/xorg-server/xkeyboard-config/compat/ledcaps index fc3084eec..f1460ba36 100644 --- a/xorg-server/xkeyboard-config/compat/ledcaps +++ b/xorg-server/xkeyboard-config/compat/ledcaps @@ -1,23 +1,24 @@ -// Use Caps Lock LED to show either Caps Lock, Group, or Shift Lock state +// Use the Caps Lock LED to show either +// Caps Lock, Group, or Shift Lock state. -default partial xkb_compatibility "caps_lock" { - indicator "Caps Lock" { - !allowExplicit; - whichModState= Locked; - modifiers= Lock; - }; +default partial xkb_compatibility "caps_lock" { + indicator "Caps Lock" { + !allowExplicit; + whichModState= Locked; + modifiers= Lock; + }; }; -partial xkb_compatibility "group_lock" { - indicator "Caps Lock" { - modifiers= None; - groups=All-group1; - }; +partial xkb_compatibility "group_lock" { + indicator "Caps Lock" { + modifiers= None; + groups=All-group1; + }; }; -partial xkb_compatibility "shift_lock" { - indicator "Caps Lock" { - whichModState= Locked; - modifiers= Shift; - }; +partial xkb_compatibility "shift_lock" { + indicator "Caps Lock" { + whichModState= Locked; + modifiers= Shift; + }; }; diff --git a/xorg-server/xkeyboard-config/compat/lednum b/xorg-server/xkeyboard-config/compat/lednum index 24a60a595..bfdcd744e 100644 --- a/xorg-server/xkeyboard-config/compat/lednum +++ b/xorg-server/xkeyboard-config/compat/lednum @@ -1,23 +1,24 @@ -// Use Num Lock LED to show either Num Lock, Group, or Shift Lock state +// Use the Num Lock LED to show either +// Num Lock, Group, or Shift Lock state. -default partial xkb_compatibility "num_lock" { +default partial xkb_compatibility "num_lock" { indicator "Num Lock" { - !allowExplicit; - whichModState= Locked; - modifiers= NumLock; - }; + !allowExplicit; + whichModState= Locked; + modifiers= NumLock; + }; }; -partial xkb_compatibility "group_lock" { - indicator "Num Lock" { - modifiers= None; - groups=All-group1; - }; +partial xkb_compatibility "group_lock" { + indicator "Num Lock" { + modifiers= None; + groups=All-group1; + }; }; -partial xkb_compatibility "shift_lock" { - indicator "Num Lock" { - whichModState= Locked; - modifiers= Shift; - }; +partial xkb_compatibility "shift_lock" { + indicator "Num Lock" { + whichModState= Locked; + modifiers= Shift; + }; }; diff --git a/xorg-server/xkeyboard-config/compat/ledscroll b/xorg-server/xkeyboard-config/compat/ledscroll index ca5a82c4c..a24169827 100644 --- a/xorg-server/xkeyboard-config/compat/ledscroll +++ b/xorg-server/xkeyboard-config/compat/ledscroll @@ -1,23 +1,24 @@ -// Use Scroll Lock LED to show either Scroll Lock, Group, or Shift Lock state +// Use the Scroll Lock LED to show either +// Scroll Lock, Group, or Shift Lock state. -default partial xkb_compatibility "scroll_lock" { - indicator "Scroll Lock" { - allowExplicit; - whichModState= Locked; - modifiers= ScrollLock; - }; +default partial xkb_compatibility "scroll_lock" { + indicator "Scroll Lock" { + allowExplicit; + whichModState= Locked; + modifiers= ScrollLock; + }; }; -partial xkb_compatibility "group_lock" { - indicator "Scroll Lock" { - modifiers= None; - groups=All-group1; - }; +partial xkb_compatibility "group_lock" { + indicator "Scroll Lock" { + modifiers= None; + groups=All-group1; + }; }; -partial xkb_compatibility "shift_lock" { - indicator "Scroll Lock" { - whichModState= Locked; - modifiers= Shift; - }; +partial xkb_compatibility "shift_lock" { + indicator "Scroll Lock" { + whichModState= Locked; + modifiers= Shift; + }; }; diff --git a/xorg-server/xkeyboard-config/compat/level5 b/xorg-server/xkeyboard-config/compat/level5 index 8e0cc9c38..54f749d4d 100644 --- a/xorg-server/xkeyboard-config/compat/level5 +++ b/xorg-server/xkeyboard-config/compat/level5 @@ -1,8 +1,9 @@ -// Fairly complete set of symbol interpretations -// to provide reasonable default behavior +// Fairly complete set of symbol interpretations +// to provide reasonable default behavior. -default partial xkb_compatibility "default" { - virtual_modifiers LevelFive; +default partial xkb_compatibility "default" { + + virtual_modifiers LevelFive; interpret.repeat= False; setMods.clearLocks= True; @@ -39,15 +40,17 @@ default partial xkb_compatibility "default" { action= LockMods(modifiers=LevelFive); }; }; -partial xkb_compatibility "level5_lock" { - // This defines a Level5-Lock using the NumLock real modifier in order to - // create arbitrary level-behaviour, which would not be possible with the - // virtual modifier. - // See also: types/level5 : EIGHT_LEVEL_LEVEL_FIVE_LOCK - // See also: symbols/level5(lock) - virtual_modifiers NumLock; - + +partial xkb_compatibility "level5_lock" { + // This defines a Level5-Lock using the NumLock real modifier + // in order to create arbitrary level-behaviour, which would + // not be possible with the virtual modifier. + // See also: types/level5 : EIGHT_LEVEL_LEVEL_FIVE_LOCK + // See also: symbols/level5(lock) + + virtual_modifiers NumLock; + interpret ISO_Level5_Lock { - action = LockMods(modifiers = NumLock); + action = LockMods(modifiers = NumLock); }; }; diff --git a/xorg-server/xkeyboard-config/compat/misc b/xorg-server/xkeyboard-config/compat/misc index cfe9a39b4..964f47125 100644 --- a/xorg-server/xkeyboard-config/compat/misc +++ b/xorg-server/xkeyboard-config/compat/misc @@ -1,122 +1,122 @@ -default partial xkb_compatibility "misc" { +default partial xkb_compatibility "misc" { - virtual_modifiers Alt,Meta,Super,Hyper,ScrollLock; + virtual_modifiers Alt,Meta,Super,Hyper,ScrollLock; - // Interpretations for some other useful keys + // Interpretations for some other useful keys. interpret Terminate_Server { - action = Terminate(); + action = Terminate(); }; setMods.clearLocks= True; - // Sets the "Alt" virtual modifier + // Sets the "Alt" virtual modifier. - interpret Alt_L+Any { + interpret Alt_L+Any { //useModMapMods= level1; virtualModifier= Alt; action = SetMods(modifiers=modMapMods); }; - interpret Alt_L { + interpret Alt_L { action = SetMods(modifiers=Alt); }; - interpret Alt_R+Any { + interpret Alt_R+Any { //useModMapMods= level1; virtualModifier= Alt; action = SetMods(modifiers=modMapMods); }; - interpret Alt_R { + interpret Alt_R { action = SetMods(modifiers=Alt); }; - // Sets the "Meta" virtual modifier + // Sets the "Meta" virtual modifier. - interpret Meta_L+Any { -// useModMapMods= level1; + interpret Meta_L+Any { + //useModMapMods= level1; virtualModifier= Meta; action = SetMods(modifiers=modMapMods); }; - interpret Meta_L { + interpret Meta_L { action = SetMods(modifiers=Meta); }; - interpret Meta_R+Any { + interpret Meta_R+Any { //useModMapMods= level1; virtualModifier= Meta; action = SetMods(modifiers=modMapMods); }; - interpret Meta_R { + interpret Meta_R { action = SetMods(modifiers=Meta); }; - // Sets the "Super" virtual modifier + // Sets the "Super" virtual modifier. - interpret Super_L+Any { -// useModMapMods= level1; + interpret Super_L+Any { + //useModMapMods= level1; virtualModifier= Super; action = SetMods(modifiers=modMapMods); }; - interpret Super_L { + interpret Super_L { action = SetMods(modifiers=Super); }; - interpret Super_R+Any { + interpret Super_R+Any { //useModMapMods= level1; virtualModifier= Super; action = SetMods(modifiers=modMapMods); }; - interpret Super_R { + interpret Super_R { action = SetMods(modifiers=Super); }; - // Sets the "Hyper" virtual modifier + // Sets the "Hyper" virtual modifier. - interpret Hyper_L+Any { -// useModMapMods= level1; + interpret Hyper_L+Any { + //useModMapMods= level1; virtualModifier= Hyper; action = SetMods(modifiers=modMapMods); }; - interpret Hyper_L { + interpret Hyper_L { action = SetMods(modifiers=Hyper); }; - interpret Hyper_R+Any { + interpret Hyper_R+Any { //useModMapMods= level1; virtualModifier= Hyper; action = SetMods(modifiers=modMapMods); }; - interpret Hyper_R { + interpret Hyper_R { action = SetMods(modifiers=Hyper); }; // Sets the "ScrollLock" virtual modifier and // makes it actually lock when pressed. Sets // up a map for the scroll lock indicator. - interpret Scroll_Lock+Any { + interpret Scroll_Lock+Any { virtualModifier= ScrollLock; action = LockMods(modifiers=modMapMods); }; include "ledscroll" - + include "misc(assign_shift_left_action)" }; -partial xkb_compatibility "assign_shift_left_action" { - // Because of the irrevertable modifier mapping in symbols/pc <LFSH> is - // getting bound to the Lock modifier when using - // symbols/shift(both_capslock), creating unwanted behaviour. +partial xkb_compatibility "assign_shift_left_action" { + // Because of the irrevertable modifier mapping in symbols/pc, + // <LFSH> is getting bound to the Lock modifier when using + // symbols/shift(both_capslock), creating unwanted behaviour. // This is a quirk, to circumvent the problem. interpret Shift_L { - action = SetMods(modifiers = Shift); + action = SetMods(modifiers = Shift); }; }; diff --git a/xorg-server/xkeyboard-config/compat/mousekeys b/xorg-server/xkeyboard-config/compat/mousekeys index f60c756c4..6b96fbcf8 100644 --- a/xorg-server/xkeyboard-config/compat/mousekeys +++ b/xorg-server/xkeyboard-config/compat/mousekeys @@ -1,147 +1,147 @@ -// Interpretations for arrow keys and a bunch of other -// common keysyms which make it possible to bind "mouse" -// keys using xmodmap and activate or deactivate them -// from the keyboard. +// Interpretations for arrow keys and a bunch of +// other common keysyms which make it possible to +// bind "mouse" keys using xmodmap and activate or +// deactivate them from the keyboard. default partial xkb_compatibility "mousekeys" { // Keypad actions. - // + interpret.repeat= True; - interpret KP_1 { - action = MovePtr(x=-1,y= +1); + interpret KP_1 { + action = MovePtr(x=-1,y= +1); }; - interpret KP_End { - action = MovePtr(x=-1,y= +1); + interpret KP_End { + action = MovePtr(x=-1,y= +1); }; - interpret KP_2 { - action = MovePtr(x=+0,y= +1); + interpret KP_2 { + action = MovePtr(x=+0,y= +1); }; - interpret KP_Down { - action = MovePtr(x=+0,y= +1); + interpret KP_Down { + action = MovePtr(x=+0,y= +1); }; - interpret KP_3 { - action = MovePtr(x=+1,y=+1); + interpret KP_3 { + action = MovePtr(x=+1,y=+1); }; - interpret KP_Next { - action = MovePtr(x=+1,y=+1); + interpret KP_Next { + action = MovePtr(x=+1,y=+1); }; - interpret KP_4 { - action = MovePtr(x=-1,y=+0); + interpret KP_4 { + action = MovePtr(x=-1,y=+0); }; - interpret KP_Left { - action = MovePtr(x=-1,y=+0); + interpret KP_Left { + action = MovePtr(x=-1,y=+0); }; - interpret KP_6 { - action = MovePtr(x=+1,y=+0); + interpret KP_6 { + action = MovePtr(x=+1,y=+0); }; - interpret KP_Right { - action = MovePtr(x=+1,y=+0); + interpret KP_Right { + action = MovePtr(x=+1,y=+0); }; - interpret KP_7 { - action = MovePtr(x=-1,y=-1); + interpret KP_7 { + action = MovePtr(x=-1,y=-1); }; - interpret KP_Home { - action = MovePtr(x=-1,y=-1); + interpret KP_Home { + action = MovePtr(x=-1,y=-1); }; - interpret KP_8 { - action = MovePtr(x=+0,y=-1); + interpret KP_8 { + action = MovePtr(x=+0,y=-1); }; - interpret KP_Up { - action = MovePtr(x=+0,y=-1); + interpret KP_Up { + action = MovePtr(x=+0,y=-1); }; - interpret KP_9 { - action = MovePtr(x=+1,y=-1); + interpret KP_9 { + action = MovePtr(x=+1,y=-1); }; - interpret KP_Prior { - action = MovePtr(x=+1,y=-1); + interpret KP_Prior { + action = MovePtr(x=+1,y=-1); }; - interpret KP_5 { - action = PointerButton(button=default); + interpret KP_5 { + action = PointerButton(button=default); }; - interpret KP_Begin { - action = PointerButton(button=default); + interpret KP_Begin { + action = PointerButton(button=default); }; - interpret KP_F2 { - action = SetPtrDflt(affect=defaultButton,button=1); + interpret KP_F2 { + action = SetPtrDflt(affect=defaultButton,button=1); }; - interpret KP_Divide { - action = SetPtrDflt(affect=defaultButton,button=1); + interpret KP_Divide { + action = SetPtrDflt(affect=defaultButton,button=1); }; - interpret KP_F3 { - action = SetPtrDflt(affect=defaultButton,button=2); + interpret KP_F3 { + action = SetPtrDflt(affect=defaultButton,button=2); }; - interpret KP_Multiply { - action = SetPtrDflt(affect=defaultButton,button=2); + interpret KP_Multiply { + action = SetPtrDflt(affect=defaultButton,button=2); }; - interpret KP_F4 { - action = SetPtrDflt(affect=defaultButton,button=3); + interpret KP_F4 { + action = SetPtrDflt(affect=defaultButton,button=3); }; - interpret KP_Subtract { - action = SetPtrDflt(affect=defaultButton,button=3); + interpret KP_Subtract { + action = SetPtrDflt(affect=defaultButton,button=3); }; - interpret KP_Separator { - action = PointerButton(button=default,count=2); + interpret KP_Separator { + action = PointerButton(button=default,count=2); }; - interpret KP_Add { + interpret KP_Add { action = PointerButton(button=default,count=2); }; - interpret KP_0 { - action = LockPointerButton(button=default,affect=lock); + interpret KP_0 { + action = LockPointerButton(button=default,affect=lock); }; - interpret KP_Insert { - action = LockPointerButton(button=default,affect=lock); + interpret KP_Insert { + action = LockPointerButton(button=default,affect=lock); }; - interpret KP_Decimal { - action = LockPointerButton(button=default,affect=unlock); + interpret KP_Decimal { + action = LockPointerButton(button=default,affect=unlock); }; - interpret KP_Delete { - action = LockPointerButton(button=default,affect=unlock); + interpret KP_Delete { + action = LockPointerButton(button=default,affect=unlock); }; - // Additional mappings for Solaris keypad compatibility + // Additional mappings for Solaris keypad compatibility. + interpret F25 { // aka KP_Divide - action = SetPtrDflt(affect=defaultButton,button=1); + action = SetPtrDflt(affect=defaultButton,button=1); }; interpret F26 { // aka KP_Multiply - action = SetPtrDflt(affect=defaultButton,button=2); + action = SetPtrDflt(affect=defaultButton,button=2); }; interpret F27 { // aka KP_Home - action = MovePtr(x=-1,y=-1); + action = MovePtr(x=-1,y=-1); }; interpret F29 { // aka KP_Prior - action = MovePtr(x=+1,y=-1); + action = MovePtr(x=+1,y=-1); }; interpret F31 { // aka KP_Begin - action = PointerButton(button=default); + action = PointerButton(button=default); }; interpret F33 { // aka KP_End - action = MovePtr(x=-1,y= +1); + action = MovePtr(x=-1,y= +1); }; interpret F35 { // aka KP_Next - action = MovePtr(x=+1,y=+1); + action = MovePtr(x=+1,y=+1); }; interpret.repeat= False; + // New keysym actions. - // New Keysym Actions. - // interpret Pointer_Button_Dflt { action= PointerButton(button=default); }; @@ -166,7 +166,7 @@ default partial xkb_compatibility "mousekeys" { interpret Pointer_DblClick3 { action= PointerButton(button=3,count=2); }; - interpret Pointer_Drag_Dflt { + interpret Pointer_Drag_Dflt { action= LockPointerButton(button=default); }; interpret Pointer_Drag1 { @@ -192,10 +192,9 @@ default partial xkb_compatibility "mousekeys" { action= SetPtrDflt(affect=defaultButton,button= -1); }; - // Allow an indicator for MouseKeys. indicator "Mouse Keys" { -// !allowExplicit; + //!allowExplicit; indicatorDrivesKeyboard; controls= MouseKeys; }; diff --git a/xorg-server/xkeyboard-config/compat/olpc b/xorg-server/xkeyboard-config/compat/olpc index a7a2cc425..747b444ec 100644 --- a/xorg-server/xkeyboard-config/compat/olpc +++ b/xorg-server/xkeyboard-config/compat/olpc @@ -1,51 +1,51 @@ // -// Created by Bernardo Innocenti <bernie@codewiz.org> +// Map the OLPC game keys to virtual modifiers. // -// Map the OLPC game keys to virtual modifiers +// Created by Bernardo Innocenti <bernie@codewiz.org> // -default xkb_compatibility "olpc" { +default xkb_compatibility "olpc" { include "complete" virtual_modifiers Square,Cross,Triangle,Circle; - interpret KP_Home+Any { + interpret KP_Home+Any { //useModMapMods= level1; - virtualModifier= Square; - action = SetMods(modifiers=modMapMods); + virtualModifier= Square; + action = SetMods(modifiers=modMapMods); }; - interpret KP_Home { - action = SetMods(modifiers=Square); + interpret KP_Home { + action = SetMods(modifiers=Square); }; - interpret KP_Next+Any { + interpret KP_Next+Any { //useModMapMods= level1; - virtualModifier= Cross; - action = SetMods(modifiers=modMapMods); + virtualModifier= Cross; + action = SetMods(modifiers=modMapMods); }; - interpret KP_Next { - action = SetMods(modifiers=Cross); + interpret KP_Next { + action = SetMods(modifiers=Cross); }; - interpret KP_End+Any { + interpret KP_End+Any { //useModMapMods= level1; - virtualModifier= Circle; - action = SetMods(modifiers=modMapMods); + virtualModifier= Circle; + action = SetMods(modifiers=modMapMods); }; - interpret KP_End { - action = SetMods(modifiers=Circle); + interpret KP_End { + action = SetMods(modifiers=Circle); }; - interpret KP_Prior+Any { + interpret KP_Prior+Any { //useModMapMods= level1; - virtualModifier= Triangle; - action = SetMods(modifiers=modMapMods); + virtualModifier= Triangle; + action = SetMods(modifiers=modMapMods); }; interpret KP_Prior { - action = SetMods(modifiers=Triangle); + action = SetMods(modifiers=Triangle); }; }; diff --git a/xorg-server/xkeyboard-config/compat/pc b/xorg-server/xkeyboard-config/compat/pc index e970795c7..f69b54d77 100644 --- a/xorg-server/xkeyboard-config/compat/pc +++ b/xorg-server/xkeyboard-config/compat/pc @@ -1,16 +1,16 @@ -default partial xkb_compatibility "pc" { +default partial xkb_compatibility "pc" { - // Sets the "Alt" virtual modifier + // Sets the "Alt" virtual modifier. - virtual_modifiers Alt; + virtual_modifiers Alt; setMods.clearLocks= True; - interpret Alt_L+Any { + interpret Alt_L+Any { virtualModifier= Alt; action = SetMods(modifiers=modMapMods); }; - interpret Alt_R+Any { + interpret Alt_R+Any { virtualModifier= Alt; action = SetMods(modifiers=modMapMods); }; diff --git a/xorg-server/xkeyboard-config/compat/pc98 b/xorg-server/xkeyboard-config/compat/pc98 index f7e40014a..0abd623ff 100644 --- a/xorg-server/xkeyboard-config/compat/pc98 +++ b/xorg-server/xkeyboard-config/compat/pc98 @@ -1,10 +1,11 @@ -// Minimal set of symbol interpretations to provide -// reasonable default behavior (Num lock, shift and -// caps lock and mode switch) and set up the -// automatic updating of common keyboard LEDs. +// Minimal set of symbol interpretations to provide +// reasonable default behavior (Num lock, Shift lock, +// and Mode switch) and set up the automatic updating +// of common keyboard LEDs. -default xkb_compatibility "basic" { - virtual_modifiers NumLock,AltGr; +default xkb_compatibility "basic" { + + virtual_modifiers NumLock,AltGr; interpret.repeat= False; setMods.clearLocks= True; @@ -17,7 +18,7 @@ default xkb_compatibility "basic" { // interpret Any+Lock { // action= LockMods(modifiers=Lock); -// }; +// }; interpret Num_Lock+Any { virtualModifier= NumLock; @@ -39,7 +40,7 @@ default xkb_compatibility "basic" { group 4 = AltGr; indicator.allowExplicit= False; - indicator "Caps Lock" { + indicator "Caps Lock" { whichModState= Locked; modifiers= Lock; }; diff --git a/xorg-server/xkeyboard-config/compat/xfree86 b/xorg-server/xkeyboard-config/compat/xfree86 index 52e661dce..cc4381974 100644 --- a/xorg-server/xkeyboard-config/compat/xfree86 +++ b/xorg-server/xkeyboard-config/compat/xfree86 @@ -1,6 +1,6 @@ -// XFree86 special keysyms +// XFree86 special keysyms. -default partial xkb_compatibility "basic" { +default partial xkb_compatibility "basic" { interpret.repeat= True; diff --git a/xorg-server/xkeyboard-config/compat/xtest b/xorg-server/xkeyboard-config/compat/xtest index 5ee88ccf8..f2ca6430d 100644 --- a/xorg-server/xkeyboard-config/compat/xtest +++ b/xorg-server/xkeyboard-config/compat/xtest @@ -1,18 +1,17 @@ -default xkb_compatibility "xtest" { +default xkb_compatibility "xtest" { // Minimal set of symbol interpretations to provide - // reasonable behavior for testing. The X Test - // Suite assumes that it can set any modifier by - // simulating a KeyPress and clear it by simulating - // a KeyRelease. Because of the way that XKB - // implements locking/latching modifiers, this - // approach fails in some cases (typically the - // lock or num lock modifiers). These symbol - // interpretations make all modifier keys just - // set the corresponding modifier so that xtest + // reasonable behavior for testing. + // The X Test Suite assumes that it can set any modifier + // by simulating a KeyPress and clear it by simulating a + // KeyRelease. Because of the way that XKB implements + // locking/latching modifiers, this approach fails in + // some cases (typically the Lock or NumLock modifiers). + // These symbol interpretations make all modifier keys + // just set the corresponding modifier so that xtest // will see the behavior it expects. - virtual_modifiers NumLock,AltGr; + virtual_modifiers NumLock,AltGr; interpret.repeat= False; setMods.clearLocks= True; @@ -43,7 +42,7 @@ default xkb_compatibility "xtest" { group 4 = AltGr; indicator.allowExplicit= False; - indicator "Caps Lock" { + indicator "Caps Lock" { modifiers= Lock; }; indicator "Num Lock" { diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in index 42fda3fb2..eb9586680 100644 --- a/xorg-server/xkeyboard-config/rules/base.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.xml.in @@ -1838,6 +1838,13 @@ </variant> <variant> <configItem> + <name>eeyek</name> + <description>Manipuri (Eeyek)</description> + <languageList><iso639Id>mni</iso639Id></languageList> + </configItem> + </variant> + <variant> + <configItem> <name>guj</name> <!-- Keyboard indicator for Gujarati layouts --> <_shortDescription>gu</_shortDescription> diff --git a/xorg-server/xkeyboard-config/symbols/il b/xorg-server/xkeyboard-config/symbols/il index a1f615c62..24028a867 100644 --- a/xorg-server/xkeyboard-config/symbols/il +++ b/xorg-server/xkeyboard-config/symbols/il @@ -1,78 +1,74 @@ // based on a keyboard map from an 'xkb/symbols/il' file -// This is a partial implemetation of the Israeli standard SI-1452 -// It does not implement changes to the English layout ("Alt-English"), -// as I believe that it is not the job of this layout to modify the English -// layout. +// This is an implemetation of the Israeli standard SI-1452 (2013) +// It does not implement changes to the English layout, as that part +// of the standard is not normative nor really useful in the context +// of xkb. +// This implementation extends the standard with Yiddish digraphs +// (a common extension) and Nun Hafukha (a fun character). + default partial alphanumeric_keys xkb_symbols "basic" { // uses the kbd layout in use in Israel. name[Group1]= "Hebrew"; + key.type[Group1] = "FOUR_LEVEL_SEMIALPHABETIC"; - key <AD01> { [ slash, Q ] }; - key <AD02> { [ apostrophe, W ] }; - key <AD04> { [ hebrew_resh, R ] }; - key <AD05> { [ hebrew_aleph,T ] }; - key <AD06> { [ hebrew_tet, Y ] }; - key <AD07> { [ hebrew_waw, U ] }; - key <AD08> { [ hebrew_finalnun, I ] }; - key <AD09> { [ hebrew_finalmem, O ] }; - key <AD10> { [ hebrew_pe, P ] }; + key <AB01> { [ hebrew_zain, Z ] }; + key <AB02> { [ hebrew_samech, X, U05B6 ] }; // Segol + key <AB03> { [ hebrew_bet, C, U05B1 ] }; // Hataf Segol + key <AB04> { [ hebrew_he, V ] }; + key <AB05> { [ hebrew_nun, B, NoSymbol, U05C6 ]}; // Nun Hafukha + key <AB06> { [ hebrew_mem, N ] }; + key <AB07> { [ hebrew_zade, M, U05B5 ] }; // Tsere + key <AB08> { [ hebrew_taw, greater, rightsinglequotemark ]}; // greater Mirrored + key <AB09> { [ hebrew_finalzade, less, singlelowquotemark ]}; // less Mirrored - key <AC02> { [ hebrew_dalet,S ] }; + key <AC01> { [ hebrew_shin, A, U05B0 ] }; // Shva + key <AC02> { [ hebrew_dalet,S, U05BC ] }; // Dagesh key <AC03> { [ hebrew_gimel,D ] }; key <AC04> { [ hebrew_kaph, F ] }; - key <AC05> { [ hebrew_ayin, G ] }; - key <AC06> { [ hebrew_yod, H ] }; - key <AC07> { [ hebrew_chet, J ] }; + key <AC05> { [ hebrew_ayin, G, U05F1 ] }; // Yiddish Vav Yod + key <AC06> { [ hebrew_yod, H, U05F2 ] }; // Yiddish Double Yod + key <AC07> { [ hebrew_chet, J, U05B4 ] }; // Hiriq key <AC08> { [ hebrew_lamed, K ] }; - key <AC09> { [ hebrew_finalkaph, L ] }; - key <AC10> { [ hebrew_finalpe, colon ] }; - key <AC11> { [ comma, quotedbl ] }; + key <AC09> { [ hebrew_finalkaph, L, rightdoublequotemark ]}; + key <AC10> { [ hebrew_finalpe, colon, doublelowquotemark ]}; - key <AB01> { [ hebrew_zain, Z ] }; - key <AB02> { [ hebrew_samech, X ] }; - key <AB03> { [ hebrew_bet, C ] }; - key <AB04> { [ hebrew_he, V ] }; - key <AB05> { [ hebrew_nun, B ] }; - key <AB06> { [ hebrew_mem, N ] }; - key <AB07> { [ hebrew_zade, M ] }; - // Mirrored: - key <AB08> { [ hebrew_taw, greater ] }; - key <AB09> { [ hebrew_finalzade, less ] }; - - key.type[Group1] = "THREE_LEVEL"; - - key <TLDE> { [ semicolon, asciitilde,0x10005b0 ]}; // Sheva - key <AB10> { [ period, question, 0x10005c3 ]}; // Sof Pasuq - key <AD03> { [ hebrew_qoph, E, EuroSign ]}; - key <AC01> { [ hebrew_shin, A, 0x10020AA ]}; - - // The following may get overriden by the iso9995-3(basic101) symbols. - // therefore they are included here. - // Including them isn't a great idea (for instance: what if group 1 uses - // UK keyboard mapping, and maps shift-3 to sterling? This mapping won't - // preserve that, and I'm not sure that this is a good feature. - key <AE01> { [ 1, exclam , 0x10005b1 ]}; // H. Segol - key <AE02> { [ 2, at , 0x10005b2 ]}; // H. Patah - key <AE03> { [ 3, numbersign , 0x10005b3 ]}; // H. Qamats - key <AE04> { [ 4, dollar , 0x10005b4 ]}; // Hiriq - key <AE05> { [ 5, percent , 0x10005b5 ]}; // Tsere - key <AE06> { [ 6, asciicircum , 0x10005b6 ]}; // Segol - key <AE07> { [ 7, ampersand , 0x10005b7 ]}; // Patah - key <AE08> { [ 8, asterisk , 0x10005b8 ]}; // Qamats - // Mirrored: - key <AE09> { [ 9, parenright , 0x10005c2 ]}; // Sin dot - key <AE10> { [ 0, parenleft , 0x10005c1 ]}; // Shin dot - key <AE11> { [ minus, underscore , 0x10005b9 ]}; // Holam - key <AE12> { [ equal, plus , 0x10005bc ]}; // Dagesh/Shuruq - - // Mirrored: - key <AD11> { [ bracketright, braceright, 0x10005bf ]}; // Rafe - key <AD12> { [ bracketleft, braceleft, 0x10005bd ]}; // Meteg - - key <BKSL> { [ backslash, bar, 0x10005bb ]}; // Qubuts + key <AD01> { [ slash, Q, U05C2 ] }; // Sin Dot + key <AD02> { [ apostrophe, W, U05C1 ] }; // Shin Dot + key <AD03> { [ hebrew_qoph, E, U05B8 ] }; // Qamats + key <AD04> { [ hebrew_resh, R, U05B3 ] }; // Hataf Qamats + key <AD05> { [ hebrew_aleph,T ] }; + key <AD06> { [ hebrew_tet, Y, U05F0 ] }; // Yiddish Double Vav + key <AD07> { [ hebrew_waw, U, U05B9 ] }; // Holam + key <AD08> { [ hebrew_finalnun, I ] }; + key <AD09> { [ hebrew_finalmem, O ] }; + key <AD10> { [ hebrew_pe, P, U05B7 ] }; // Patah + + key.type[Group1] = "FOUR_LEVEL"; + + // Non-alphanumeric keys + key <AB10> { [ period, question, division ]}; + key <AC11> { [ comma, quotedbl, U05F4] }; // Gershayim + key <AD11> { [ bracketright, braceright, U05B2 ]}; // Mirrored; Hataf Patah + key <AD12> { [ bracketleft, braceleft, U05BF ]}; // Mirrored; Rafe + key <BKSL> { [ backslash, bar, U05BB ] }; // Qubuts + + // Top (digits) row + key <TLDE> { [ semicolon, asciitilde, U05F3 ]}; // Geresh + key <AE01> { [ 1, exclam ] }; + key <AE02> { [ 2, at ] }; + key <AE03> { [ 3, numbersign, EuroSign ]}; + key <AE04> { [ 4, dollar, NewSheqelSign ]}; + key <AE05> { [ 5, percent, degree ]}; + key <AE06> { [ 6, asciicircum, U05AB ]}; // Hebrew Accent Ole + key <AE07> { [ 7, ampersand, U05BD ]}; // Meteg + key <AE08> { [ 8, asterisk, multiply]}; + key <AE09> { [ 9, parenright, U200E ]}; // LRM; Paren Mirrored + key <AE10> { [ 0, parenleft, U200F ]}; // RLM; Paren Mirrored + key <AE11> { [ minus, underscore, U05BE ]}; // Maqaf + key <AE12> { [ equal, plus, endash ]}; include "level3(ralt_switch)" }; diff --git a/xorg-server/xkeyboard-config/symbols/in b/xorg-server/xkeyboard-config/symbols/in index fdf008887..f70e215e6 100644 --- a/xorg-server/xkeyboard-config/symbols/in +++ b/xorg-server/xkeyboard-config/symbols/in @@ -2013,4 +2013,72 @@ xkb_symbols "tel-kagapa" { include "level3(ralt_switch)" }; -// ---- END Telugu KaGaPa ---- + +// Description : Keymap for Manipuri language (Meetei mayek script) +// Encoding : Unicode (http://www.unicode.org) +// Author : Santosh Heigrujam <santosh.tomba@gmail.com> +// Date : December, 2013 +// Source : +// Comment : + +partial alphanumeric_keys modifier_keys +xkb_symbols "eeyek" { + + name[Group1]= "Manipuri (Eeyek)"; + + // Alphanumeric section + key <TLDE> { [ grave, asciitilde ] }; + key <AE01> { [ Uabf1, exclam ] }; + key <AE02> { [ Uabf2, at ] }; + key <AE03> { [ Uabf3, numbersign ] }; + key <AE04> { [ Uabf4, dollar ] }; + key <AE05> { [ Uabf5, percent ] }; + key <AE06> { [ Uabf6, asciicircum ] }; + key <AE07> { [ Uabf7, ampersand ] }; + key <AE08> { [ Uabf8, asterisk ] }; + key <AE09> { [ Uabf9, parenleft ] }; + key <AE10> { [ Uabf0, parenright ] }; + key <AE11> { [ minus, underscore ] }; + key <AE12> { [ equal, plus ] }; + + key <AD01> { [ Uabc8, Uabd8 ] }; + key <AD02> { [ Uabcb, Uabcb ] }; + key <AD03> { [ Uabcf, Uabe2 ] }; + key <AD04> { [ Uabd4, Uabd4 ] }; + key <AD05> { [ Uabc7, Uabe0 ] }; + key <AD06> { [ Uabcc, Uabe6 ] }; + key <AD07> { [ Uabce, Uabe8 ] }; + key <AD08> { [ Uabe4, Uabe9 ] }; + key <AD09> { [ Uabe3, Uabe7 ] }; + key <AD10> { [ Uabc4, Uabde ] }; + key <AD11> { [ bracketleft, braceleft ] }; + key <AD12> { [ bracketright, braceright ] }; + + key <AC01> { [ Uabd1, Uabe5 ] }; + key <AC02> { [ Uabc1, Uabd3 ] }; + key <AC03> { [ Uabd7, Uabd9 ] }; + key <AC04> { [ Uabd0, Uabda ] }; + key <AC05> { [ Uabd2, Uabd8 ] }; + key <AC06> { [ Uabcd, Uabea ] }; + key <AC07> { [ Uabd6, Uabd3 ] }; + key <AC08> { [ Uabc0, Uabdb ] }; + key <AC09> { [ Uabc2, Uabdc ] }; + key <AC10> { [ semicolon, colon ] }; + key <AC11> { [ apostrophe, quotedbl ] }; + + key <AB01> { [ Uabc9, Uabe1 ] }; + key <AB02> { [ Uabca, Uabd9 ] }; + key <AB03> { [ Uabc6, Uabeb ] }; + key <AB04> { [ Uabda, Uabed ] }; + key <AB05> { [ Uabd5, Uabec ] }; + key <AB06> { [ Uabc5, Uabdf ] }; + key <AB07> { [ Uabc3, Uabdd ] }; + key <AB08> { [ comma, less ] }; + key <AB09> { [ period, greater ] }; + key <AB10> { [ slash, question ] }; + + key <BKSL> { [ backslash, bar ] }; + // End alphanumeric section + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/la b/xorg-server/xkeyboard-config/symbols/la index 20c36c559..a77e971d3 100644 --- a/xorg-server/xkeyboard-config/symbols/la +++ b/xorg-server/xkeyboard-config/symbols/la @@ -76,7 +76,7 @@ xkb_symbols "stea" { name[Group1]= "Lao (STEA proposed standard layout)"; - key <TLDE> { [ quotedbl, apostrophe ]}; + key <TLDE> { [ quotedbl, apostrophe ]}; key <AE01> { [ 0x1000ea2, 1, 0x1000ed1 ]}; key <AE02> { [ 0x1000e9f, 2, 0x1000ed2 ]}; key <AE03> { [ 0x1000ec2, 3, 0x1000ed3 ]}; @@ -88,48 +88,48 @@ xkb_symbols "stea" { key <AE09> { [ 0x1000e88, 7, 0x1000ed9 ]}; key <AE10> { [ 0x1000e82, 8, 0x1000ed0 ]}; key <AE11> { [ 0x1000e8a, 9 ]}; - key <AE12> { [ 0x1000ecd ]}; + key <AE12> { [ 0x1000ecd ]}; key <AD01> { [ 0x1000ebb ]}; key <AD02> { [ 0x1000ec4, 0 ]}; - key <AD03> { [ 0x1000eb3, asterisk ]}; - key <AD04> { [ 0x1000e9e, underscore ]}; - key <AD05> { [ 0x1000eb0, plus ]}; + key <AD03> { [ 0x1000eb3, asterisk ]}; + key <AD04> { [ 0x1000e9e, underscore ]}; + key <AD05> { [ 0x1000eb0, plus ]}; key <AD06> { [ 0x1000eb4 ]}; key <AD07> { [ 0x1000eb5 ]}; - key <AD08> { [ 0x1000eae, 0x1000ea3 ]}; + key <AD08> { [ 0x1000eae, 0x1000ea3 ]}; key <AD09> { [ 0x1000e99, 0x1000edc ]}; key <AD10> { [ 0x1000e8d, 0x1000ebd ]}; - key <AD11> { [ 0x1000e9a, minus ]}; - key <AD12> { [ 0x1000ea5 ]}; - key <BKSL> { [ slash, backslash ]}; + key <AD11> { [ 0x1000e9a, minus ]}; + key <AD12> { [ 0x1000ea5 ]}; + key <BKSL> { [ slash, backslash ]}; - key <AC01> { [ 0x1000eb1 ]}; + key <AC01> { [ 0x1000eb1 ]}; key <AC02> { [ 0x1000eab, semicolon ]}; - key <AC03> { [ 0x1000e81, period ]}; - key <AC04> { [ 0x1000e94, comma ]}; - key <AC05> { [ 0x1000ec0, colon ]}; + key <AC03> { [ 0x1000e81, period ]}; + key <AC04> { [ 0x1000e94, comma ]}; + key <AC05> { [ 0x1000ec0, colon ]}; key <AC06> { [ 0x1000ec9, 0x1000eca ]}; key <AC07> { [ 0x1000ec8, 0x1000ecb ]}; - key <AC08> { [ 0x1000eb2, exclam ]}; - key <AC09> { [ 0x1000eaa, question ]}; - key <AC10> { [ 0x1000ea7, percent ]}; - key <AC11> { [ 0x1000e87, equal ]}; + key <AC08> { [ 0x1000eb2, exclam ]}; + key <AC09> { [ 0x1000eaa, question ]}; + key <AC10> { [ 0x1000ea7, percent ]}; + key <AC11> { [ 0x1000e87, equal ]}; key <AB01> { [ 0x1000e9c, 0x10020ad ]}; key <AB02> { [ 0x1000e9b, parenleft ]}; key <AB03> { [ 0x1000ec1, 0x1000eaf ]}; - key <AB04> { [ 0x1000ead, x ]}; + key <AB04> { [ 0x1000ead, x ]}; key <AB05> { [ 0x1000eb6 ]}; key <AB06> { [ 0x1000eb7 ]}; key <AB07> { [ 0x1000e97, 0x1000ec6 ]}; key <AB08> { [ 0x1000ea1, 0x1000edd ]}; - key <AB09> { [ 0x1000ec3, dollar ]}; - key <AB10> { [ 0x1000e9d, parenright ]}; + key <AB09> { [ 0x1000ec3, dollar ]}; + key <AB10> { [ 0x1000e9d, parenright ]}; - key <SPCE> { [ space, nobreakspace, nobreakspace ]}; + key <SPCE> { [ space, nobreakspace, nobreakspace ]}; - key <KPDL> { [ comma, period ]}; + key <KPDL> { [ comma, period ]}; include "level3(ralt_switch)" }; diff --git a/xorg-server/xkeyboard-config/types/README b/xorg-server/xkeyboard-config/types/README index 1a1e2c01e..ff0f61b9d 100644 --- a/xorg-server/xkeyboard-config/types/README +++ b/xorg-server/xkeyboard-config/types/README @@ -1,4 +1,4 @@ The types component of a keyboard mapping specifies the key types that can be -associated with the various keyboard keys. The types component can also -optionally contain real modifiers binding and symbolic names for one -or more virtual modifiers. +associated with the various keyboard keys. The types component can optionally +contain also real modifier bindings and symbolic names for one or more virtual +modifiers. diff --git a/xorg-server/xkeyboard-config/types/basic b/xorg-server/xkeyboard-config/types/basic index 552b83400..341931fe5 100644 --- a/xorg-server/xkeyboard-config/types/basic +++ b/xorg-server/xkeyboard-config/types/basic @@ -1,7 +1,7 @@ default xkb_types "basic" { // Fairly standard definitions for - // the four required key types + // the three required key types. virtual_modifiers NumLock; @@ -19,11 +19,11 @@ default xkb_types "basic" { }; type "ALPHABETIC" { - modifiers = Shift+Lock; - map[Shift] = Level2; - map[Lock] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Caps"; + modifiers = Shift+Lock; + map[Shift] = Level2; + map[Lock] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; }; }; diff --git a/xorg-server/xkeyboard-config/types/caps b/xorg-server/xkeyboard-config/types/caps index dd7fa2eaf..baff8c4f8 100644 --- a/xorg-server/xkeyboard-config/types/caps +++ b/xorg-server/xkeyboard-config/types/caps @@ -1,5 +1,5 @@ -// CapsLock uses internal capitalization rules -// Shift "pauses" CapsLock +// CapsLock uses internal capitalization rules, +// Shift "pauses" CapsLock. partial xkb_types "internal" { type "ALPHABETIC" { modifiers = Shift+Lock; @@ -17,7 +17,7 @@ partial xkb_types "internal" { map[LevelThree] = Level3; map[Shift+LevelThree] = Level4; map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level3; preserve[Lock+LevelThree] = Lock; level_name[Level1] = "Base"; level_name[Level2] = "Shift"; @@ -33,7 +33,7 @@ partial xkb_types "internal" { map[LevelThree] = Level3; map[Shift+LevelThree] = Level4; map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; + map[Lock+Shift+LevelThree] = Level4; preserve[Lock+LevelThree] = Lock; preserve[Lock+Shift+LevelThree] = Lock; level_name[Level1] = "Base"; @@ -42,8 +42,9 @@ partial xkb_types "internal" { level_name[Level4] = "Shift Alt"; }; }; -// CapsLock uses internal capitalization rules -// Shift doesn't cancel CapsLock + +// CapsLock uses internal capitalization rules, +// Shift doesn't cancel CapsLock. partial xkb_types "internal_nocancel" { type "ALPHABETIC" { modifiers = Shift; @@ -77,8 +78,9 @@ partial xkb_types "internal_nocancel" { level_name[Level4] = "Shift Alt"; }; }; -// CapsLock acts as Shift with locking -// Shift "pauses" CapsLock + +// CapsLock acts as Shift with locking, +// Shift "pauses" CapsLock. partial xkb_types "shift" { type "ALPHABETIC" { modifiers = Shift+Lock; @@ -111,7 +113,7 @@ partial xkb_types "shift" { map[LevelThree] = Level3; map[Shift+LevelThree] = Level4; map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; + map[Lock+Shift+LevelThree] = Level4; preserve[Lock+LevelThree] = Lock; preserve[Lock+Shift+LevelThree] = Lock; level_name[Level1] = "Base"; @@ -120,8 +122,9 @@ partial xkb_types "shift" { level_name[Level4] = "Shift Alt"; }; }; -// CapsLock acts as Shift with locking -// Shift doesn't cancel CapsLock + +// CapsLock acts as Shift with locking, +// Shift doesn't cancel CapsLock. partial xkb_types "shift_nocancel" { type "ALPHABETIC" { modifiers = Shift+Lock; @@ -157,7 +160,7 @@ partial xkb_types "shift_nocancel" { map[LevelThree] = Level3; map[Shift+LevelThree] = Level4; map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; + map[Lock+Shift+LevelThree] = Level4; preserve[Lock+LevelThree] = Lock; preserve[Lock+Shift+LevelThree] = Lock; level_name[Level1] = "Base"; diff --git a/xorg-server/xkeyboard-config/types/extra b/xorg-server/xkeyboard-config/types/extra index 465796b53..e7529f40d 100644 --- a/xorg-server/xkeyboard-config/types/extra +++ b/xorg-server/xkeyboard-config/types/extra @@ -1,20 +1,20 @@ partial default xkb_types "default" { - // Definition for a key type used for the czech keymap, for instance. - // Defines style a with four level shift. It is similar to three_level - // type used for iso9995 but it lets the shift key behave "normally". + + // Defines a type with a four-level shift, similar to the three-level + // type used for iso9995, but it lets the Shift key behave "normally". virtual_modifiers LevelThree; type "FOUR_LEVEL" { - modifiers = Shift+LevelThree; + modifiers = Shift+LevelThree; map[None] = Level1; map[Shift] = Level2; map[LevelThree] = Level3; map[Shift+LevelThree] = Level4; level_name[Level1] = "Base"; level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; }; type "FOUR_LEVEL_ALPHABETIC" { @@ -40,7 +40,7 @@ partial default xkb_types "default" { map[LevelThree] = Level3; map[Shift+LevelThree] = Level4; map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; + map[Lock+Shift+LevelThree] = Level4; preserve[Lock+LevelThree] = Lock; preserve[Lock+Shift+LevelThree] = Lock; level_name[Level1] = "Base"; @@ -49,11 +49,9 @@ partial default xkb_types "default" { level_name[Level4] = "Shift Alt"; }; - // Another four level keypad variant - // First two levels are controled by NumLock (with active Shift-ing like - // in KEYPAD). LevelThree overrides this mode, with two additional - // Shift-ed levels - // NumLock state is intentionnaly ignored when LevelThree is active + // A four-level keypad variant. The first two levels are controlled by + // NumLock (with active shifting like in KEYPAD). LevelThree overrides + // this mode, with two additional shifted levels. type "FOUR_LEVEL_MIXED_KEYPAD" { modifiers = Shift+NumLock+LevelThree; map[None] = Level1; @@ -61,32 +59,32 @@ partial default xkb_types "default" { map[NumLock] = Level2; map[Shift] = Level2; map[LevelThree] = Level3; - map[NumLock+LevelThree] = Level3; + map[NumLock+LevelThree] = Level3; map[Shift+LevelThree] = Level4; - map[Shift+NumLock+LevelThree] = Level4; + map[Shift+NumLock+LevelThree] = Level4; level_name[Level1] = "Base"; level_name[Level2] = "Number"; level_name[Level3] = "Alt Base"; level_name[Level4] = "Shift Alt"; }; - // Base level, two Shift-ed LevelThree levels, one Ctrl+Alt command level + // Base level, two shifted LevelThree levels, one Ctrl+Alt command level. type "FOUR_LEVEL_X" { modifiers = Shift+LevelThree+Control+Alt; map[None] = Level1; map[LevelThree] = Level2; - map[Shift+LevelThree] = Level3; - map[Control+Alt] = Level4; + map[Shift+LevelThree] = Level3; + map[Control+Alt] = Level4; level_name[Level1] = "Base"; level_name[Level2] = "Alt Base"; level_name[Level3] = "Shift Alt"; - level_name[Level4] = "Ctrl+Alt"; + level_name[Level4] = "Ctrl+Alt"; }; -// Special type for keys used in Serbian Latin Unicode map -// It makes it possible to use all three forms of latin letters -// present in Unicode that are made up of two separate letters -// (forms like LJ, Lj, and lj; NJ, Nj, and nj; etc) +// A special type for keys used in the Serbian Latin Unicode keymap. +// It makes it possible to use all three forms of latin letters +// present in Unicode that are made up of two separate letters +// (forms like LJ, Lj, and lj; NJ, Nj, and nj; etcetera). type "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC" { modifiers = Shift+Lock+LevelThree; @@ -105,21 +103,20 @@ partial default xkb_types "default" { level_name[Level4] = "Shift AltGr"; }; -// type for e.g. german ssharp which is capitalized SS. +// A key type for the German ssharp (for example), which is capitalized as SS. // CHARACTERISTICS: -// It is FOUR_LEVEL with the exception that the fifth level -// is mapped to the Lock modifier. -// If other modifiers are used, the Lock state is ignored. +// It is FOUR_LEVEL with the exception that the fifth level is mapped to the +// Lock modifier. If other modifiers are used, the Lock state is ignored. // DETAILS ABOUT GERMAN: -// The capital form of ssharp (called sharp s) only exists for -// completely capitalized Text, not at the beginning of sentences -// or nouns (nouns have a captial letter at the beginning in german). -// The ssharp key, to the right of the zero key, takes this into -// account and has a questionmark mapped on shift-ssharp since -// normally no capital version is needed. -// When typing with active capsLock, this key type is needed to -// output two capital letters S because this is the only german key -// whose capital letter is not the same as the one typed with shift. +// The capital form of ssharp (called sharp s) only exists for completely +// capitalized text, not for words at the beginning of sentences nor for +// nouns (nouns in German normally start with a captial letter). +// The ssharp key, to the right of the zero key, takes this into account +// and has a questionmark mapped to Shift-ssharp since normally no capital +// version is needed. +// When typing with active CapsLock, this key type is needed to +// output two capital letters S because this is the only German key +// whose capital letter is not the same as the one typed with Shift. type "FOUR_LEVEL_PLUS_LOCK" { modifiers = Shift+Lock+LevelThree; @@ -139,7 +136,7 @@ partial default xkb_types "default" { }; }; -// This enables the four level shifting also for the keypad. +// This enables the four-level shifting also for the keypad. partial xkb_types "keypad" { virtual_modifiers LevelThree; @@ -157,5 +154,5 @@ partial xkb_types "keypad" { level_name[Level2] = "Number"; level_name[Level3] = "Alt Base"; level_name[Level4] = "Alt Number"; - }; + }; }; diff --git a/xorg-server/xkeyboard-config/types/iso9995 b/xorg-server/xkeyboard-config/types/iso9995 index 0cf34203c..d3c4e0bf6 100644 --- a/xorg-server/xkeyboard-config/types/iso9995 +++ b/xorg-server/xkeyboard-config/types/iso9995 @@ -1,8 +1,8 @@ partial default xkb_types "default" { - // Definition for a key type which - // can be used to implement ISO9995 - // style level three shift + // A key type which can be used to implement + // an ISO9995-style level-three shift. + virtual_modifiers LevelThree; type "THREE_LEVEL" { diff --git a/xorg-server/xkeyboard-config/types/level5 b/xorg-server/xkeyboard-config/types/level5 index 672f0a1b3..1796f502d 100644 --- a/xorg-server/xkeyboard-config/types/level5 +++ b/xorg-server/xkeyboard-config/types/level5 @@ -1,12 +1,12 @@ partial default xkb_types "default" { - // Definition for a key type used for the czech keymap, for instance. - // Defines style a with four level shift. It is similar to three_level - // type used for iso9995 but it lets the shift key behave "normally". + + // Defines a type with an eight-level shift, similar to the three-level + // type used for iso9995, but it lets the Shift key behave "normally". virtual_modifiers LevelThree,ScrollLock,LevelFive; type "EIGHT_LEVEL" { - modifiers = Shift+LevelThree+LevelFive; + modifiers = Shift+LevelThree+LevelFive; map[None] = Level1; map[Shift] = Level2; map[LevelThree] = Level3; @@ -17,8 +17,8 @@ partial default xkb_types "default" { map[Shift+LevelThree+LevelFive] = Level8; level_name[Level1] = "Base"; level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; level_name[Level5] = "X"; level_name[Level6] = "X Shift"; level_name[Level7] = "X Alt Base"; @@ -33,7 +33,7 @@ partial default xkb_types "default" { map[LevelThree] = Level3; map[Shift+LevelThree] = Level4; map[Lock+LevelThree] = Level4; - map[Lock+Shift+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level3; map[LevelFive] = Level5; map[Shift+LevelFive] = Level6; @@ -41,7 +41,7 @@ partial default xkb_types "default" { map[LevelThree+LevelFive] = Level7; map[Shift+LevelThree+LevelFive] = Level8; map[Lock+LevelThree+LevelFive] = Level8; - map[Lock+Shift+LevelThree+LevelFive] = Level7; + map[Lock+Shift+LevelThree+LevelFive] = Level7; level_name[Level1] = "Base"; level_name[Level2] = "Shift"; @@ -54,9 +54,9 @@ partial default xkb_types "default" { }; // type "EIGHT_LEVEL_LEVEL_FIVE_LOCK" { -// // Level5-Lock is implemented by using NumLock, because a real modifier -// // is required. -// +// // Level5-Lock is implemented by using NumLock, because a real modifier +// // is required. +// // modifiers = Shift + Lock + LevelThree + NumLock + LevelFive; // // map[None] = Level1; @@ -116,11 +116,11 @@ partial default xkb_types "default" { // }; // // type "EIGHT_LEVEL_ALPHABETIC_LEVEL_FIVE_LOCK" { -// // Level5-Lock is implemented by using NumLock, because a real modifier -// // is required. -// +// // Level5-Lock is implemented by using NumLock, because a real modifier +// // is required. +// // modifiers = Shift + Lock + LevelThree + NumLock + LevelFive; -// +// // map[None] = Level1; // map[Shift] = Level2; // map[LevelThree] = Level3; @@ -183,7 +183,7 @@ partial default xkb_types "default" { map[LevelThree] = Level3; map[Shift+LevelThree] = Level4; map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; + map[Lock+Shift+LevelThree] = Level4; map[LevelFive] = Level5; map[Shift+LevelFive] = Level6; @@ -192,7 +192,7 @@ partial default xkb_types "default" { map[LevelThree+LevelFive] = Level7; map[Shift+LevelThree+LevelFive] = Level8; map[Lock+LevelThree+LevelFive] = Level7; - map[Lock+Shift+LevelThree+LevelFive] = Level8; + map[Lock+Shift+LevelThree+LevelFive] = Level8; preserve[Lock+LevelThree] = Lock; preserve[Lock+Shift+LevelThree] = Lock; diff --git a/xorg-server/xkeyboard-config/types/mousekeys b/xorg-server/xkeyboard-config/types/mousekeys index 88d88a21e..901848aa3 100644 --- a/xorg-server/xkeyboard-config/types/mousekeys +++ b/xorg-server/xkeyboard-config/types/mousekeys @@ -2,9 +2,9 @@ partial default xkb_types "default" { virtual_modifiers Alt; type "SHIFT+ALT" { - modifiers = Shift+Alt; - map[Shift+Alt] = Level2; - level_name[Level1] = "Base"; + modifiers = Shift+Alt; + map[Shift+Alt] = Level2; + level_name[Level1] = "Base"; level_name[Level2] = "Shift+Alt"; }; }; diff --git a/xorg-server/xkeyboard-config/types/nokia b/xorg-server/xkeyboard-config/types/nokia index f77d8868a..300fe4169 100644 --- a/xorg-server/xkeyboard-config/types/nokia +++ b/xorg-server/xkeyboard-config/types/nokia @@ -1,6 +1,7 @@ partial default xkb_types "default" { - // Some types that are used by Nokia devices and keyboard. + // A type that is used by Nokia devices and keyboards. + virtual_modifiers LevelThree; type "PC_FN_LEVEL2" { diff --git a/xorg-server/xkeyboard-config/types/numpad b/xorg-server/xkeyboard-config/types/numpad index 7888d7db1..5861f118a 100644 --- a/xorg-server/xkeyboard-config/types/numpad +++ b/xorg-server/xkeyboard-config/types/numpad @@ -11,7 +11,7 @@ partial default xkb_types "pc" { include "extra(keypad)" }; -// On Mac keypads, level 1 and 2 are swapped +// On Mac keypads, level 1 and 2 are swapped. partial xkb_types "mac" { type "KEYPAD" { modifiers = None; @@ -33,11 +33,11 @@ partial xkb_types "microsoft" { include "extra(keypad)" }; -// Swiss-German style numeric keypad: Shift and NumLock operates as +// Swiss-German style numeric keypad: Shift and NumLock operate as // two independent modifiers; however, since we want shift state for // the cursor keys, only three levels are used from the key mappings. -// Closest type is actually FOUR_LEVEL_X, but most numpad layouts uses -// FOUR_LEVEL_MIXED_KEYPAD so that's the one we are going to override. +// Closest type is actually FOUR_LEVEL_X, but most numpad layouts use +// FOUR_LEVEL_MIXED_KEYPAD, so that's the one we are going to override. partial xkb_types "shift3" { type "FOUR_LEVEL_MIXED_KEYPAD" { modifiers = Shift+NumLock+Control+Alt; diff --git a/xorg-server/xkeyboard-config/types/pc b/xorg-server/xkeyboard-config/types/pc index daebe7442..17e494b30 100644 --- a/xorg-server/xkeyboard-config/types/pc +++ b/xorg-server/xkeyboard-config/types/pc @@ -2,7 +2,8 @@ partial default xkb_types "default" { // Some types that are necessary // for a full implementation of - // a PC compatible keyboard. + // a PC-compatible keyboard. + virtual_modifiers Alt; virtual_modifiers LevelThree; virtual_modifiers LAlt; @@ -74,13 +75,13 @@ partial default xkb_types "default" { level_name[Level5] = "Ctrl+Alt"; }; - // Local eight level - // Needed when you want part of your layout eight-level but can not use - // LevelFive as modifier, as this will take over right ctrl by default - // for all the layout and is too invasive for your average four-level user - // Needed to fix bug #9529 - // FIXME Should really use RControl but it's seems not to be enabled by - // default and touching this requires a lot of testing + // Local eight level. + // Needed when you want part of your layout eight-level but cannot use + // LevelFive as modifier, as this will take over the right Ctrl by default + // for the whole layout and is too invasive for the average four-level user. + // Needed to fix bug #9529. + // FIXME: Should really use RControl but it seems not to be enabled by + // default and touching this requires a lot of testing. type "LOCAL_EIGHT_LEVEL" { modifiers = Shift+Lock+LevelThree+Control; |