Commit cd342074 authored by Damien George's avatar Damien George
Browse files

py: Can compile with -Wmissing-declarations and -Wmissing-prototypes.

parent 3dd1c0a8
......@@ -30,6 +30,7 @@
mp_obj_t mp_builtin___import__(mp_uint_t n_args, const mp_obj_t *args);
mp_obj_t mp_builtin_open(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs);
mp_obj_t mp_micropython_mem_info(mp_uint_t n_args, const mp_obj_t *args);
MP_DECLARE_CONST_FUN_OBJ(mp_builtin___build_class___obj);
MP_DECLARE_CONST_FUN_OBJ(mp_builtin___import___obj);
......@@ -91,11 +92,6 @@ extern const mp_obj_module_t mp_module_gc;
extern const mp_obj_dict_t mp_module_builtins_globals;
struct _dummy_t;
extern struct _dummy_t mp_sys_stdin_obj;
extern struct _dummy_t mp_sys_stdout_obj;
extern struct _dummy_t mp_sys_stderr_obj;
// extmod modules
extern const mp_obj_module_t mp_module_uctypes;
extern const mp_obj_module_t mp_module_uzlib;
......
......@@ -406,6 +406,7 @@ STATIC mp_obj_t mp_builtin_print(mp_uint_t n_args, const mp_obj_t *args, mp_map_
end_data = mp_obj_str_get_data(end_elem->value, &end_len);
}
#if MICROPY_PY_IO
extern mp_uint_t mp_sys_stdout_obj; // type is irrelevant, just need pointer
mp_obj_t stream_obj = &mp_sys_stdout_obj;
mp_map_elem_t *file_elem = mp_map_lookup(kwargs, MP_OBJ_NEW_QSTR(MP_QSTR_file), MP_MAP_LOOKUP);
if (file_elem != NULL && file_elem->value != mp_const_none) {
......
......@@ -37,6 +37,11 @@
/// \module sys - system specific functions
// defined per port; type of these is irrelevant, just need pointer
extern mp_uint_t mp_sys_stdin_obj;
extern mp_uint_t mp_sys_stdout_obj;
extern mp_uint_t mp_sys_stderr_obj;
// These two lists must be initialised per port (after the call to mp_init).
// TODO document these properly, they aren't constants or functions...
/// \constant path - a mutable list of directories to search for imported modules
......
......@@ -36,6 +36,7 @@
#include "py/runtime0.h"
#include "py/runtime.h"
#include "py/stackctrl.h"
#include "py/pfenv.h"
mp_obj_type_t *mp_obj_get_type(mp_const_obj_t o_in) {
if (MP_OBJ_IS_SMALL_INT(o_in)) {
......@@ -52,13 +53,6 @@ const char *mp_obj_get_type_str(mp_const_obj_t o_in) {
return qstr_str(mp_obj_get_type(o_in)->name);
}
void printf_wrapper(void *env, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
}
void mp_obj_print_helper(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) {
// There can be data structures nested too deep, or just recursive
MP_STACK_CHECK();
......
......@@ -26,6 +26,8 @@
#ifndef __MICROPY_INCLUDED_PY_PFENV_H__
#define __MICROPY_INCLUDED_PY_PFENV_H__
#include <stdarg.h>
#include "py/obj.h"
#define PF_FLAG_LEFT_ADJUST (0x001)
......@@ -54,7 +56,7 @@ int pfenv_print_mp_int(const pfenv_t *pfenv, mp_obj_t x, int sgn, int base, int
int pfenv_print_float(const pfenv_t *pfenv, mp_float_t f, char fmt, int flags, char fill, int width, int prec);
#endif
//int pfenv_vprintf(const pfenv_t *pfenv, const char *fmt, va_list args);
int pfenv_vprintf(const pfenv_t *pfenv, const char *fmt, va_list args);
int pfenv_printf(const pfenv_t *pfenv, const char *fmt, ...);
// Wrapper for system printf
......
......@@ -27,6 +27,7 @@
#include <assert.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "py/pfenv.h"
......@@ -193,3 +194,10 @@ int pfenv_printf(const pfenv_t *pfenv, const char *fmt, ...) {
va_end(ap);
return ret;
}
void printf_wrapper(void *env, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
}
......@@ -27,8 +27,8 @@
#include <stdarg.h>
#include <stdio.h>
#include "py/obj.h"
#include "py/emit.h"
#include "py/runtime.h"
#if MICROPY_WARNINGS
......
......@@ -36,8 +36,6 @@
#include "py/formatfloat.h"
#endif
int pfenv_vprintf(const pfenv_t *pfenv, const char *fmt, va_list args);
STATIC void stdout_print_strn(void *dummy_env, const char *str, mp_uint_t len) {
stdout_tx_strn_cooked(str, len);
}
......
......@@ -34,6 +34,7 @@
#include "py/nlr.h"
#include "py/runtime.h"
#include "py/stream.h"
#include "py/builtin.h"
#ifdef _WIN32
#define fsync _commit
......
......@@ -51,7 +51,7 @@ STATIC void gc_helper_get_regs(regs_t arr) {
#ifdef __x86_64__
typedef mp_uint_t regs_t[6];
void gc_helper_get_regs(regs_t arr) {
STATIC void gc_helper_get_regs(regs_t arr) {
register long rbx asm ("rbx");
register long rbp asm ("rbp");
register long r12 asm ("r12");
......
......@@ -482,7 +482,6 @@ int main(int argc, char **argv) {
}
if (mp_verbose_flag) {
extern mp_obj_t mp_micropython_mem_info(mp_uint_t n_args, const mp_obj_t *args);
mp_micropython_mem_info(0, NULL);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment