[Mplayer-cvslog] CVS: main mp_msg.c,1.5,1.6

Arpi of Ize arpi at mplayer.dev.hu
Wed Sep 26 20:41:18 CEST 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv15545

Modified Files:
	mp_msg.c 
Log Message:
cleanup

Index: mp_msg.c
===================================================================
RCS file: /cvsroot/mplayer/main/mp_msg.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- mp_msg.c	22 Sep 2001 15:43:52 -0000	1.5
+++ mp_msg.c	26 Sep 2001 18:40:57 -0000	1.6
@@ -26,44 +26,38 @@
 
 void mp_msg_c( int x, const char *format, ... ){
     va_list va;
-    char tmp[8*80];
     if((x&255)>mp_msg_levels[x>>8]) return; // do not display
     va_start(va, format);
-    vsnprintf( tmp,128,format,va );
-/*    
-    if((x&255)<=MSGL_ERR){
-//	fprintf(stderr,"%%%%%% ");
-	vfprintf(stderr,format, va);
-    } else {
-//	printf("%%%%%% ");
-	vprintf(format, va);
-    }
-*/    
-    va_end(va);
-    switch( x&255 )
-     {
+#ifdef HAVE_NEW_GUI
+    if(use_gui){
+      char tmp[8*80];
+      vsnprintf( tmp,8*80,format,va ); tmp[8*80-1]=0;
+      switch( x&255 ) {
        case MSGL_FATAL: 
               fprintf( stderr,"%s",tmp );
-              #ifdef HAVE_NEW_GUI
-               if ( use_gui ) gtkMessageBox( GTK_MB_FATAL|GTK_MB_SIMPLE,tmp );
-              #endif
+              gtkMessageBox( GTK_MB_FATAL|GTK_MB_SIMPLE,tmp );
        	   break;
        case MSGL_ERR:
               fprintf( stderr,"%s",tmp );
-              #ifdef HAVE_NEW_GUI 
-               if ( use_gui ) gtkMessageBox( GTK_MB_ERROR|GTK_MB_SIMPLE,tmp );
-              #endif
+              gtkMessageBox( GTK_MB_ERROR|GTK_MB_SIMPLE,tmp );
        	   break;
        case MSGL_WARN:
               printf( "%s",tmp );
-              #ifdef HAVE_NEW_GUI 
-               if ( use_gui ) gtkMessageBox( GTK_MB_WARNING|GTK_MB_SIMPLE,tmp );
-              #endif
+              gtkMessageBox( GTK_MB_WARNING|GTK_MB_SIMPLE,tmp );
        	   break;
        default:
               printf( "%s",tmp );
-       	   break;
-     }
+      }
+    } else
+#endif
+    if((x&255)<=MSGL_ERR){
+//    fprintf(stderr,"%%%%%% ");
+      vfprintf(stderr,format, va);
+    } else {
+//	printf("%%%%%% ");
+      vprintf(format, va);
+    }
+    va_end(va);
 }
 
 #else




More information about the MPlayer-cvslog mailing list