xwin: Get rid of xstrdup when argument is definitely non-NULL
ditto for XWin Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
		
							parent
							
								
									dd45b7d746
								
							
						
					
					
						commit
						eea286f2b9
					
				| 
						 | 
				
			
			@ -441,7 +441,7 @@ winFixupPaths (void)
 | 
			
		|||
            int comment_block = FALSE;
 | 
			
		||||
 | 
			
		||||
            /* get defautl fontpath */
 | 
			
		||||
            char *fontpath = xstrdup(defaultFontPath);
 | 
			
		||||
            char *fontpath = strdup(defaultFontPath);
 | 
			
		||||
            size_t size = strlen(fontpath);
 | 
			
		||||
 | 
			
		||||
            /* read all lines */
 | 
			
		||||
| 
						 | 
				
			
			@ -528,7 +528,7 @@ winFixupPaths (void)
 | 
			
		|||
 | 
			
		||||
            /* cleanup */
 | 
			
		||||
            fclose(fontdirs);  
 | 
			
		||||
            defaultFontPath = xstrdup(fontpath);
 | 
			
		||||
            defaultFontPath = strdup(fontpath);
 | 
			
		||||
            free(fontpath);
 | 
			
		||||
            changed_fontpath = TRUE;
 | 
			
		||||
            font_from = X_CONFIG;
 | 
			
		||||
| 
						 | 
				
			
			@ -600,7 +600,7 @@ winFixupPaths (void)
 | 
			
		|||
            }
 | 
			
		||||
        } 
 | 
			
		||||
 | 
			
		||||
        defaultFontPath = xstrdup(newfp);
 | 
			
		||||
        defaultFontPath = strdup(newfp);
 | 
			
		||||
        free(newfp);
 | 
			
		||||
        changed_fontpath = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -676,7 +676,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
 | 
			
		|||
      fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
 | 
			
		||||
 | 
			
		||||
      // Override the GL extensions string set by __glXScreenInit()
 | 
			
		||||
      screen->base.GLextensions = xstrdup(gl_extensions);
 | 
			
		||||
      screen->base.GLextensions = strdup(gl_extensions);
 | 
			
		||||
 | 
			
		||||
      // Generate the GLX extensions string (overrides that set by __glXScreenInit())
 | 
			
		||||
      {
 | 
			
		||||
| 
						 | 
				
			
			@ -706,13 +706,13 @@ glxWinScreenProbe(ScreenPtr pScreen)
 | 
			
		|||
 | 
			
		||||
          if (screen->has_WGL_ARB_multisample)
 | 
			
		||||
            {
 | 
			
		||||
              screen->base.GLXversion = xstrdup("1.4");
 | 
			
		||||
              screen->base.GLXversion = strdup("1.4");
 | 
			
		||||
              screen->base.GLXmajor = 1;
 | 
			
		||||
              screen->base.GLXminor = 4;
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
            {
 | 
			
		||||
              screen->base.GLXversion = xstrdup("1.3");
 | 
			
		||||
              screen->base.GLXversion = strdup("1.3");
 | 
			
		||||
              screen->base.GLXmajor = 1;
 | 
			
		||||
              screen->base.GLXminor = 3;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -583,7 +583,7 @@ winConfigFiles ()
 | 
			
		|||
  else if (filesptr != NULL && filesptr->file_fontpath)
 | 
			
		||||
    {
 | 
			
		||||
      from = X_CONFIG;
 | 
			
		||||
      defaultFontPath = xstrdup (filesptr->file_fontpath);
 | 
			
		||||
      defaultFontPath = strdup (filesptr->file_fontpath);
 | 
			
		||||
    }
 | 
			
		||||
  winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -630,7 +630,7 @@ winSetStrOption (pointer optlist, const char *name, char *deflt)
 | 
			
		|||
  if (ParseOptionValue (-1, optlist, &o))
 | 
			
		||||
    deflt = o.value.str;
 | 
			
		||||
  if (deflt)
 | 
			
		||||
    return xstrdup (deflt);
 | 
			
		||||
    return strdup (deflt);
 | 
			
		||||
  else
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue