Fix some unused variables, and silence a clang warning about initialization override in vmentrytable.h

This commit is contained in:
Antonin ENFRUN 2014-05-12 00:21:50 +02:00
parent ceac71f1f5
commit da1fffaa09
4 changed files with 18 additions and 6 deletions

View File

@ -151,6 +151,7 @@ STATIC const mp_map_elem_t mp_module_math_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_copysign), (mp_obj_t)&mp_math_copysign_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_copysign), (mp_obj_t)&mp_math_copysign_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_fabs), (mp_obj_t)&mp_math_fabs_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_fabs), (mp_obj_t)&mp_math_fabs_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_floor), (mp_obj_t)&mp_math_floor_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_floor), (mp_obj_t)&mp_math_floor_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_fmod), (mp_obj_t)&mp_math_fmod_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_frexp), (mp_obj_t)&mp_math_frexp_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_frexp), (mp_obj_t)&mp_math_frexp_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ldexp), (mp_obj_t)&mp_math_ldexp_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_ldexp), (mp_obj_t)&mp_math_ldexp_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_modf), (mp_obj_t)&mp_math_modf_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_modf), (mp_obj_t)&mp_math_modf_obj },

View File

@ -168,11 +168,13 @@ MP_DEFINE_EXCEPTION(Exception, BaseException)
MP_DEFINE_EXCEPTION(KeyError, LookupError) MP_DEFINE_EXCEPTION(KeyError, LookupError)
MP_DEFINE_EXCEPTION(MemoryError, Exception) MP_DEFINE_EXCEPTION(MemoryError, Exception)
MP_DEFINE_EXCEPTION(NameError, Exception) MP_DEFINE_EXCEPTION(NameError, Exception)
MP_DEFINE_EXCEPTION_BASE(NameError)
//MP_DEFINE_EXCEPTION(UnboundLocalError, NameError)
MP_DEFINE_EXCEPTION(OSError, Exception)
MP_DEFINE_EXCEPTION_BASE(OSError)
/* /*
MP_DEFINE_EXCEPTION_BASE(NameError)
MP_DEFINE_EXCEPTION(UnboundLocalError, NameError)
*/
MP_DEFINE_EXCEPTION(OSError, Exception)
/*
MP_DEFINE_EXCEPTION_BASE(OSError)
MP_DEFINE_EXCEPTION(BlockingIOError, OSError) MP_DEFINE_EXCEPTION(BlockingIOError, OSError)
MP_DEFINE_EXCEPTION(ChildProcessError, OSError) MP_DEFINE_EXCEPTION(ChildProcessError, OSError)
MP_DEFINE_EXCEPTION(ConnectionError, OSError) MP_DEFINE_EXCEPTION(ConnectionError, OSError)

View File

@ -24,6 +24,11 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winitializer-overrides"
#endif // __clang__
static void* entry_table[256] = { static void* entry_table[256] = {
[0 ... 255] = &&entry_default, [0 ... 255] = &&entry_default,
[MP_BC_LOAD_CONST_FALSE] = &&entry_MP_BC_LOAD_CONST_FALSE, [MP_BC_LOAD_CONST_FALSE] = &&entry_MP_BC_LOAD_CONST_FALSE,
@ -110,3 +115,7 @@ static void* entry_table[256] = {
[MP_BC_IMPORT_FROM] = &&entry_MP_BC_IMPORT_FROM, [MP_BC_IMPORT_FROM] = &&entry_MP_BC_IMPORT_FROM,
[MP_BC_IMPORT_STAR] = &&entry_MP_BC_IMPORT_STAR, [MP_BC_IMPORT_STAR] = &&entry_MP_BC_IMPORT_STAR,
}; };
#if __clang__
#pragma clang diagnostic pop
#endif // __clang__

View File

@ -291,6 +291,7 @@ STATIC const mp_obj_type_t microsocket_type = {
.locals_dict = (mp_obj_t)&microsocket_locals_dict, .locals_dict = (mp_obj_t)&microsocket_locals_dict,
}; };
#if MICROPY_SOCKET_EXTRA
STATIC mp_obj_t mod_socket_htons(mp_obj_t arg) { STATIC mp_obj_t mod_socket_htons(mp_obj_t arg) {
return MP_OBJ_NEW_SMALL_INT((machine_int_t)htons(MP_OBJ_SMALL_INT_VALUE(arg))); return MP_OBJ_NEW_SMALL_INT((machine_int_t)htons(MP_OBJ_SMALL_INT_VALUE(arg)));
} }
@ -308,7 +309,6 @@ STATIC mp_obj_t mod_socket_inet_aton(mp_obj_t arg) {
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_socket_inet_aton_obj, mod_socket_inet_aton); STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_socket_inet_aton_obj, mod_socket_inet_aton);
#if MICROPY_SOCKET_EXTRA
STATIC mp_obj_t mod_socket_gethostbyname(mp_obj_t arg) { STATIC mp_obj_t mod_socket_gethostbyname(mp_obj_t arg) {
assert(MP_OBJ_IS_TYPE(arg, &mp_type_str)); assert(MP_OBJ_IS_TYPE(arg, &mp_type_str));
const char *s = mp_obj_str_get_str(arg); const char *s = mp_obj_str_get_str(arg);
@ -321,7 +321,7 @@ STATIC mp_obj_t mod_socket_gethostbyname(mp_obj_t arg) {
return mp_obj_new_int(*(int*)*h->h_addr_list); return mp_obj_new_int(*(int*)*h->h_addr_list);
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_socket_gethostbyname_obj, mod_socket_gethostbyname); STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_socket_gethostbyname_obj, mod_socket_gethostbyname);
#endif #endif // MICROPY_SOCKET_EXTRA
STATIC mp_obj_t mod_socket_getaddrinfo(uint n_args, const mp_obj_t *args) { STATIC mp_obj_t mod_socket_getaddrinfo(uint n_args, const mp_obj_t *args) {
// TODO: Implement all args // TODO: Implement all args