Remove debugging warning, be consistent about API fails.
Nick Ing-Simmons [Sun, 3 Feb 2002 20:03:38 +0000 (20:03 +0000)]
p4raw-id: //depot/perlio@14545

ext/Encode/Encode.xs

index 22812ab..53167f4 100644 (file)
@@ -309,12 +309,12 @@ PerlIOEncode_flush(pTHX_ PerlIO * f)
            XPUSHs(e->enc);
            SvCUR_set(e->bufsv, e->base.ptr - e->base.buf);
            SvUTF8_on(e->bufsv);
-           Perl_warn(aTHX_ "flush %_",e->bufsv);
            XPUSHs(e->bufsv);
            XPUSHs(&PL_sv_yes);
            PUTBACK;
-           if (perl_call_method("encode", G_SCALAR) != 1)
-               code = -1;
+           if (perl_call_method("encode", G_SCALAR) != 1) {
+               Perl_die(aTHX_ "panic: encode did not return a value");
+           }
            SPAGAIN;
            str = POPs;
            PUTBACK;
@@ -357,8 +357,9 @@ PerlIOEncode_flush(pTHX_ PerlIO * f)
                XPUSHs(str);
                XPUSHs(&PL_sv_yes);
                PUTBACK;
-               if (perl_call_method("encode", G_SCALAR) != 1)
-                   code = -1;
+               if (perl_call_method("encode", G_SCALAR) != 1) {
+                    Perl_die(aTHX_ "panic: encode did not return a value");
+               }
                SPAGAIN;
                str = POPs;
                PUTBACK;