[xiph-cvs] cvs commit: vorbis-tools/oggenc encode.c oggenc.c utf8.c

Michael Smith msmith at xiph.org
Thu Aug 9 23:59:18 PDT 2001



msmith      01/08/09 23:59:17

  Modified:    oggenc   Tag: tools-pre-rc2 encode.c oggenc.c utf8.c
  Log:
  Make oggenc produce useful return values, as requested by someone.
  Useful for people scripting things.
  
  remove an unused variable.

Revision  Changes    Path
No                   revision

No                   revision

1.7.6.2   +3 -0      vorbis-tools/oggenc/encode.c

Index: encode.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/encode.c,v
retrieving revision 1.7.6.1
retrieving revision 1.7.6.2
diff -u -r1.7.6.1 -r1.7.6.2
--- encode.c	2001/08/05 05:41:25	1.7.6.1
+++ encode.c	2001/08/10 06:59:13	1.7.6.2
@@ -167,6 +167,9 @@
                 }
         }
 
+	ret = 0; /* Success, set return value to 0 since other things reuse it
+			  * for nefarious purposes. */
+
         /* Cleanup time */
 cleanup:
 

1.17.2.2  +7 -2      vorbis-tools/oggenc/oggenc.c

Index: oggenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/oggenc.c,v
retrieving revision 1.17.2.1
retrieving revision 1.17.2.2
diff -u -r1.17.2.1 -r1.17.2.2
--- oggenc.c	2001/08/05 05:41:25	1.17.2.1
+++ oggenc.c	2001/08/10 06:59:13	1.17.2.2
@@ -64,6 +64,7 @@
 
         char **infiles;
         int numfiles;
+	int errors=0;
 
         parse_options(argc, argv, &opt);
 
@@ -145,6 +146,7 @@
                         {
                                 fprintf(stderr, "ERROR: Cannot open input file \"%s\"\n", infiles[i]);
                                 free(out_fn);
+				errors++;
                                 continue;
                         }
 
@@ -178,6 +180,7 @@
                 if(!foundformat)
                 {
                         fprintf(stderr, "ERROR: Input file \"%s\" is not a supported format\n", infiles[i]);
+			errors++;
                         continue;
                 }
 
@@ -226,6 +229,7 @@
                                 if(closein)
                                         fclose(in);
                                 fprintf(stderr, "ERROR: Cannot open output file \"%s\"\n", out_fn);
+				errors++;
                                 free(out_fn);
                                 continue;
                         }	
@@ -249,7 +253,8 @@
                         enc_opts.end_encode = final_statistics_null;
                 }
 
-		oe_encode(&enc_opts); /* Should we care about return val? */
+		if(oe_encode(&enc_opts))
+			errors++;
 
                 if(out_fn) free(out_fn);
                 vorbis_comment_clear(&vc);
@@ -262,7 +267,7 @@
                         fclose(out);
         }/* Finished this file, loop around to next... */
 
-	return 0;
+	return errors?1:0;
 
 }
 

1.5.2.1   +1 -1      vorbis-tools/oggenc/utf8.c

Index: utf8.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/utf8.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- utf8.c	2001/07/26 12:34:37	1.5
+++ utf8.c	2001/08/10 06:59:14	1.5.2.1
@@ -91,7 +91,7 @@
 #ifdef HAVE_ICONV
         static unsigned char buffer[BUFSIZE];
     char *from_p, *to_p;
-	size_t from_left, to_left, ret;
+	size_t from_left, to_left;
         iconv_t cd;
 #endif
 

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list