aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/registry.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/registry.c')
-rwxr-xr-x[-rw-r--r--]xorg-server/dix/registry.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xorg-server/dix/registry.c b/xorg-server/dix/registry.c
index 84d48b4e3..aaccfbd09 100644..100755
--- a/xorg-server/dix/registry.c
+++ b/xorg-server/dix/registry.c
@@ -23,6 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include "resource.h"
@@ -271,7 +272,7 @@ RegisterResourceName(RESTYPE resource, const char *name)
resource &= TypeMask;
while (resource >= nresource) {
- if (!double_size(&resources, nresource, sizeof(char *)))
+ if (!double_size((void*)&resources, nresource, sizeof(char *)))
return;
nresource = nresource ? nresource * 2 : BASE_SIZE;
}
@@ -318,7 +319,7 @@ dixFreeRegistry(void)
#endif
#ifdef X_REGISTRY_RESOURCE
- free(resources);
+ free((void*)resources);
resources = NULL;
nresource = 0;
@@ -343,7 +344,7 @@ void
dixResetRegistry(void)
{
#ifdef X_REGISTRY_REQUEST
- ExtensionEntry extEntry = { .name = CORE };
+ ExtensionEntry extEntry;
#endif
dixFreeRegistry();
@@ -356,6 +357,8 @@ dixResetRegistry(void)
"Failed to open protocol names file " FILENAME "\n");
/* Add the core protocol */
+ memset(&extEntry, 0, sizeof(extEntry));
+ extEntry.name = CORE;
RegisterExtensionNames(&extEntry);
#endif