mirror of
				git://git.code.sf.net/p/cdesktopenv/code
				synced 2025-03-09 15:50:02 +00:00 
			
		
		
		
	Fix a bunch of -Wempty-body warnings reported by clang
Many of these were real bugs, like: if (cond); do_something etc... Others were just cosmetic - like placing the ';' on a separate line to make the intention clear.
This commit is contained in:
		
							parent
							
								
									18e25ce273
								
							
						
					
					
						commit
						dda11f0e38
					
				
					 11 changed files with 28 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -573,7 +573,8 @@ _DtPrintGetDefaultXPrinterName(
 | 
			
		|||
    else if((default_printer = getenv("XPRINTER")) != (String)NULL);
 | 
			
		||||
    else if((default_printer = getenv("PDPRINTER")) != (String)NULL);
 | 
			
		||||
    else if((default_printer = getenv("LPDEST")) != (String)NULL);
 | 
			
		||||
    else if((default_printer = getenv("PRINTER")) != (String)NULL);
 | 
			
		||||
    else if((default_printer = getenv("PRINTER")) != (String)NULL)
 | 
			
		||||
        ;
 | 
			
		||||
    /*
 | 
			
		||||
     * return a copy of the printer name
 | 
			
		||||
     */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -149,7 +149,7 @@ _GetMwmWindow(
 | 
			
		|||
		}
 | 
			
		||||
	    }
 | 
			
		||||
 | 
			
		||||
	    if (rcode == Success);
 | 
			
		||||
	    if (rcode == Success)
 | 
			
		||||
	    {
 | 
			
		||||
		*pMwmWindow = pWmInfo->wmWindow;
 | 
			
		||||
	    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3670,7 +3670,7 @@ attch_ed_verify_props(void)
 | 
			
		|||
     * Get parent of current object
 | 
			
		||||
     */
 | 
			
		||||
    parent = obj_get_parent(ats->cur_object);
 | 
			
		||||
    if (parent);
 | 
			
		||||
    if (parent)
 | 
			
		||||
        parent = obj_get_root(parent);
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2634,11 +2634,11 @@ propP_popup_message(
 | 
			
		|||
	/*
 | 
			
		||||
	 * Free help data strings
 | 
			
		||||
	 */
 | 
			
		||||
	if (help_data.help_text);
 | 
			
		||||
	if (help_data.help_text)
 | 
			
		||||
	    XtFree(help_data.help_text);
 | 
			
		||||
	if (help_data.help_volume);
 | 
			
		||||
	if (help_data.help_volume)
 | 
			
		||||
	    XtFree(help_data.help_volume);
 | 
			
		||||
	if (help_data.help_locationID);
 | 
			
		||||
	if (help_data.help_locationID)
 | 
			
		||||
	    XtFree(help_data.help_locationID);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -539,8 +539,9 @@ do_calc(void)      /* Perform arithmetic calculation and display result. */
 | 
			
		|||
      mpcdm(&dres, v->MPresult) ;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  else if (IS_KEY(v->cur_op, KEY_EQ)) /* do nothing. */ ;   /* Equals */
 | 
			
		||||
 | 
			
		||||
  else if (IS_KEY(v->cur_op, KEY_EQ))                  /* Equals */
 | 
			
		||||
      ; /* do nothing. */
 | 
			
		||||
  
 | 
			
		||||
  show_display(v->MPresult) ;
 | 
			
		||||
 | 
			
		||||
  if (!(IS_KEY(v->current, KEY_EQ) && IS_KEY(v->old_cal_value, KEY_EQ)))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -768,7 +768,8 @@ TblTableRowEnd(
 | 
			
		|||
    if ((at = FindAttValByName(e, "ROWSEP"))) {
 | 
			
		||||
	if (at[0] == '1') fprintf(fp, "_\n");
 | 
			
		||||
    }
 | 
			
		||||
    else if (rowsep) /* fprintf(fp, "_\n") */ ;
 | 
			
		||||
    else if (rowsep) /* fprintf(fp, "_\n") */
 | 
			
		||||
        ;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -705,9 +705,10 @@ ScanNLSDir(char *dirname)
 | 
			
		|||
              continue;
 | 
			
		||||
 | 
			
		||||
	    if (locale[0] != '.' &&
 | 
			
		||||
                LANGLISTSIZE > (int) (strlen(languageList)+strlen(locale)+2));
 | 
			
		||||
                LANGLISTSIZE > (int) (strlen(languageList)+strlen(locale)+2))
 | 
			
		||||
	    {
 | 
			
		||||
		(void) sprintf(locale_path, "%s/%s", dirname, locale);
 | 
			
		||||
		(void) snprintf(locale_path, MAXPATHLEN, "%s/%s",
 | 
			
		||||
                                dirname, locale);
 | 
			
		||||
	        retval = stat(locale_path, &locale_stat);
 | 
			
		||||
 | 
			
		||||
	    	if (0 == retval && S_ISDIR(locale_stat.st_mode))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -417,9 +417,14 @@ DialogManager::forceUpdate( Widget w )
 | 
			
		|||
  if ( !w )
 | 
			
		||||
    return;
 | 
			
		||||
  XtAppContext cxt=XtWidgetToApplicationContext( w );
 | 
			
		||||
  for (diashell=w;!XtIsShell(diashell);diashell=XtParent(diashell));
 | 
			
		||||
  for ( topshell=diashell;XtIsTopLevelShell( topshell );
 | 
			
		||||
	topshell = XtParent( topshell ) );
 | 
			
		||||
  for (diashell=w;
 | 
			
		||||
       !XtIsShell(diashell);
 | 
			
		||||
       diashell=XtParent(diashell))
 | 
			
		||||
      ;
 | 
			
		||||
  for ( topshell=diashell;
 | 
			
		||||
        XtIsTopLevelShell( topshell );
 | 
			
		||||
        topshell = XtParent( topshell ) )
 | 
			
		||||
      ;
 | 
			
		||||
 | 
			
		||||
//  if (XtIsRealized(diashell) && XtIsRealized(topshell)){
 | 
			
		||||
    dpy=XtDisplay(diashell);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2050,8 +2050,8 @@ DtMail::MailRc::expand(char *name)
 | 
			
		|||
	close(pivec[1]);
 | 
			
		||||
	l = read(pivec[0], xname, LINESIZE);
 | 
			
		||||
	close(pivec[0]);
 | 
			
		||||
	while (wait(&s) != pid);
 | 
			
		||||
		;
 | 
			
		||||
	while (wait(&s) != pid)
 | 
			
		||||
            ;
 | 
			
		||||
	s &= 0377;
 | 
			
		||||
	if (s != 0 && s != SIGPIPE) {
 | 
			
		||||
		fprintf(stderr, "Echo failed\n");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -789,8 +789,9 @@ DtMailServer::retrieve_messages(DtMailEnv &error)
 | 
			
		|||
	if (ok != DTME_MailServerAccess_SocketIOError)
 | 
			
		||||
	  if (ok == DTME_NoError)
 | 
			
		||||
	    ok = ptrans_quit();
 | 
			
		||||
	  else
 | 
			
		||||
	  else {
 | 
			
		||||
	    (void) ptrans_quit();
 | 
			
		||||
          }
 | 
			
		||||
	vtalarm_setitimer(0);
 | 
			
		||||
	SockClose(_sockfp);
 | 
			
		||||
	_sockfp = NULL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -280,7 +280,7 @@ PrintSetupDestroy(PrintSetup *pSetup)
 | 
			
		|||
 | 
			
		||||
    if (pSetup->docName)
 | 
			
		||||
      free(pSetup->docName);
 | 
			
		||||
    if (pSetup->dtprintSetup);
 | 
			
		||||
    if (pSetup->dtprintSetup)
 | 
			
		||||
      _psReleasePrintSetupDialog(pSetup);
 | 
			
		||||
    XtFree((char*) pSetup);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue