cvs: gd /libgd/src gd_tga.c

[email protected] ("Mattias Bengtsson") Tue, 16 Oct 2007 21:36:50 -0000
Newsgroups php.gd.cvs
Message-ID <cvsmattias1192570610@cvsserver>
mattias		Tue Oct 16 21:36:50 2007 UTC

  Modified files:              
    /gd/libgd/src	gd_tga.c 
  Log:
  - Performance hit
  
http://cvs.php.net/viewvc.cgi/gd/libgd/src/gd_tga.c?r1=1.3&r2=1.4&diff_format=u
Index: gd/libgd/src/gd_tga.c
diff -u gd/libgd/src/gd_tga.c:1.3 gd/libgd/src/gd_tga.c:1.4
--- gd/libgd/src/gd_tga.c:1.3	Sat Oct 13 18:18:27 2007
+++ gd/libgd/src/gd_tga.c	Tue Oct 16 21:36:49 2007
@@ -153,9 +153,16 @@
 	printf("wxh: %i %i\n", tga->width, tga->height);
 #endif 
 
-	if (tga->bits != 8 && tga->bits != 24 && tga->bits != 16 && tga->bits != 32) {
-		fprintf(stderr, "bps %i not supported", tga->bits);
-		return -1;
+	switch(tga->bits) {
+		case 8:
+		case 16:
+		case 24:
+		case 32:
+			break;
+		default:
+			fprintf(stderr, "bps %i not supported", tga->bits);
+			return -1;
+			break;
 	}
 
 	tga->ident = (char *) gdMalloc(tga->identsize * sizeof( char ));