X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3622daa901777a33969d8bc04e2d62dee14d164..cce4b3fe2b05e1d928d7a5930c33c624b2f3a667:/src/gtk/utilsres.cpp diff --git a/src/gtk/utilsres.cpp b/src/gtk/utilsres.cpp index db55e4f964..d14f938bde 100644 --- a/src/gtk/utilsres.cpp +++ b/src/gtk/utilsres.cpp @@ -2,8 +2,7 @@ // Name: utils.cpp // Purpose: // Author: Robert Roebling -// Created: 01/02/97 -// Id: +// Id: $Id$ // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -83,7 +82,7 @@ static char *GetResourcePath(char *buf, char *name, bool create) // the Real User, then determine the Real home dir. static char *GetIniFile(char *dest, const char *filename) { - char *home = NULL; + char *home = (char *) NULL; if (filename && wxIsAbsolutePath(filename)) { strcpy(dest, filename); @@ -110,7 +109,7 @@ static char *GetIniFile(char *dest, const char *filename) return dest; } -static void wxXMergeDatabases(void) +static void wxXMergeDatabases() { XrmDatabase homeDB, serverDB, applicationDB; char filenamebuf[1024]; @@ -133,7 +132,7 @@ static void wxXMergeDatabases(void) if (XResourceManagerString(GDK_DISPLAY()) != NULL) { serverDB = XrmGetStringDatabase(XResourceManagerString(GDK_DISPLAY())); } else { - (void)GetIniFile(filename, NULL); + (void)GetIniFile(filename, (char *) NULL); serverDB = XrmGetFileDatabase(filename); } if (serverDB) @@ -144,7 +143,7 @@ static void wxXMergeDatabases(void) if ((environment = getenv("XENVIRONMENT")) == NULL) { size_t len; - environment = GetIniFile(filename, NULL); + environment = GetIniFile(filename, (const char *) NULL); len = strlen(environment); #if !defined(SVR4) || defined(__sgi) (void)gethostname(environment + len, 1024 - len); @@ -160,13 +159,14 @@ static void wxXMergeDatabases(void) // called on application exit //----------------------------------------------------------------------------- -void wxFlushResources(void) +void wxFlushResources() { char nameBuffer[512]; wxNode *node = wxTheResourceCache->First(); while (node) { - char *file = node->key.string; + wxString str = node->GetKeyString(); + char *file = WXSTRINGCAST str; // If file doesn't exist, create it first. (void)GetResourcePath(nameBuffer, file, TRUE); @@ -255,10 +255,14 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value, // home directory instead of current directory -- JACS (void)GetIniFile(buffer, file); - wxNode *node = wxTheResourceCache->Find(buffer); + wxNode *node = (wxNode*) NULL; /* suppress egcs warning */ + node = wxTheResourceCache->Find(buffer); if (node) + { database = (XrmDatabase)node->Data(); - else { + } + else + { database = XrmGetFileDatabase(buffer); wxLogTrace(wxTraceResAlloc, "Get: Number = %d", wxTheResourceCache->Number()); wxTheResourceCache->Append(buffer, (wxObject *)database); @@ -291,10 +295,10 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value, bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file ) { - char *s = NULL; + char *s = (char *) NULL; bool succ = wxGetResource(section, entry, &s, file); if (succ) { - *value = (float)strtod(s, NULL); + *value = (float)strtod(s, (char **) NULL); delete[]s; return TRUE; } else @@ -303,10 +307,10 @@ bool wxGetResource(const wxString& section, const wxString& entry, float *value, bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file ) { - char *s = NULL; + char *s = (char *) NULL; bool succ = wxGetResource(section, entry, &s, file); if (succ) { - *value = strtol(s, NULL, 10); + *value = strtol(s, (char **) NULL, 10); delete[]s; return TRUE; } else @@ -315,7 +319,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, long *value, bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file ) { - char *s = NULL; + char *s = (char *) NULL; bool succ = wxGetResource(section, entry, &s, file); if (succ) { // Handle True, False here @@ -327,7 +331,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c *value = FALSE; // Handle as Integer else - *value = (int)strtol(s, NULL, 10); + *value = (int)strtol(s, (char **) NULL, 10); delete[]s; return TRUE; } else