File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,19 +343,19 @@ MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_oct_obj, mp_builtin_oct);
343343
344344STATIC mp_obj_t mp_builtin_ord (mp_obj_t o_in ) {
345345 size_t len ;
346- const char * str = mp_obj_str_get_data (o_in , & len );
346+ const byte * str = ( const byte * ) mp_obj_str_get_data (o_in , & len );
347347 #if MICROPY_PY_BUILTINS_STR_UNICODE
348348 if (MP_OBJ_IS_STR (o_in )) {
349- len = utf8_charlen (( const byte * ) str , len );
349+ len = utf8_charlen (str , len );
350350 if (len == 1 ) {
351- return mp_obj_new_int (utf8_get_char (( const byte * ) str ));
351+ return mp_obj_new_int (utf8_get_char (str ));
352352 }
353353 } else
354354 #endif
355355 {
356356 // a bytes object, or a str without unicode support (don't sign extend the char)
357357 if (len == 1 ) {
358- return MP_OBJ_NEW_SMALL_INT ((( const byte * ) str ) [0 ]);
358+ return MP_OBJ_NEW_SMALL_INT (str [0 ]);
359359 }
360360 }
361361
You can’t perform that action at this time.
0 commit comments