blueloveTH 1 an în urmă
părinte
comite
1bbba50003
2 a modificat fișierele cu 1 adăugiri și 11 ștergeri
  1. 0 1
      include/pocketpy/interpreter/vm.h
  2. 1 10
      src/interpreter/vm.c

+ 0 - 1
include/pocketpy/interpreter/vm.h

@@ -41,7 +41,6 @@ typedef struct pk_VM {
     void (*_ceval_on_step)(Frame*, Bytecode);
     unsigned char* (*_import_file)(const char*);
     void (*_stdout)(const char*, ...);
-    void (*_stderr)(const char*, ...);
 
     py_TValue last_retval;
     py_TValue curr_exception;

+ 1 - 10
src/interpreter/vm.c

@@ -14,19 +14,11 @@ static unsigned char* pk_default_import_file(const char* path) { return NULL; }
 static void pk_default_stdout(const char* fmt, ...) {
     va_list args;
     va_start(args, fmt);
-    vfprintf(stdout, fmt, args);
+    vprintf(fmt, args);
     va_end(args);
     fflush(stdout);
 }
 
-static void pk_default_stderr(const char* fmt, ...) {
-    va_list args;
-    va_start(args, fmt);
-    vfprintf(stderr, fmt, args);
-    va_end(args);
-    fflush(stderr);
-}
-
 static void pk_TypeInfo__ctor(pk_TypeInfo* self,
                               py_Name name,
                               py_Type index,
@@ -65,7 +57,6 @@ void pk_VM__ctor(pk_VM* self) {
     self->_ceval_on_step = NULL;
     self->_import_file = pk_default_import_file;
     self->_stdout = pk_default_stdout;
-    self->_stderr = pk_default_stderr;
 
     self->last_retval = *py_NIL;
     self->curr_exception = *py_NIL;