]> granicus.if.org Git - php/commitdiff
Simplify a bit
authorfoobar <sniper@php.net>
Mon, 11 Aug 2003 02:32:17 +0000 (02:32 +0000)
committerfoobar <sniper@php.net>
Mon, 11 Aug 2003 02:32:17 +0000 (02:32 +0000)
ext/pdf/pdf.c

index 7d71cff681339cfb532e4362f825edf7e4c74810..78f678f87359809b9d16c25a0aa73c363a8c6d58 100644 (file)
@@ -254,31 +254,21 @@ static void _free_pdf_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
 {
        TSRMLS_FETCH();
-       switch (type){
-               case PDF_NonfatalError:
-                       /*
-                        * PDFlib warnings should be visible to the user.
-                        * If he decides to live with PDFlib warnings
-                        * he may use the PDFlib function
-                        * pdf_set_parameter($p, "warning" 0) to switch off
-                        * the warnings inside PDFlib.
-                        */
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal PDFlib warning: %s", shortmsg);
-                       return;
-               case PDF_MemoryError: /* give up in all other cases */
-               case PDF_IOError:
-               case PDF_RuntimeError:
-               case PDF_IndexError:
-               case PDF_TypeError:
-               case PDF_DivisionByZero:
-               case PDF_OverflowError:
-               case PDF_SyntaxError:
-               case PDF_ValueError:
-               case PDF_SystemError:
-               case PDF_UnknownError:
-               default:
-                       php_error_docref(NULL TSRMLS_CC, E_ERROR,"PDFlib error: %s", shortmsg);
-               }
+
+       if (type == PDF_NonfatalError) {
+               /*
+                * PDFlib warnings should be visible to the user.
+                * If he decides to live with PDFlib warnings
+                * he may use the PDFlib function
+                * pdf_set_parameter($p, "warning" 0) to switch off
+                * the warnings inside PDFlib.
+                */
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal PDFlib warning: %s", shortmsg);
+               return;
+       } else {
+               /* give up in all other cases */
+               php_error_docref(NULL TSRMLS_CC, E_ERROR,"PDFlib error: %s", shortmsg);
+       }
 }
 /* }}} */