- Sep 17, 2017
-
-
Paul Sokolovsky authored
This allows user classes to implement __abs__ special method, and saves code size (104 bytes for x86_64), even though during refactor, an issue was fixed and few optimizations were made: * abs() of minimum (negative) small int value is calculated properly. * objint_longlong and objint_mpz avoid allocating new object is the argument is already non-negative.
-
- Aug 29, 2017
-
-
Damien George authored
The unary-op/binary-op enums are already defined, and there are no arithmetic tricks used with these types, so it makes sense to use the correct enum type for arguments that take these values. It also reduces code size quite a bit for nan-boxing builds.
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Jul 18, 2017
-
-
Alexander Steffen authored
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
-
- Apr 04, 2017
-
-
Damien George authored
This reduces code duplication and allows to make mp_classify_fp_as_int static, which reduces code size.
-
- Feb 02, 2017
-
-
Nicko van Someren authored
Updated modbuiltin.c to add conditional support for 3-arg calls to pow() using MICROPY_PY_BUILTINS_POW3 config parameter. Added support in objint_mpz.c for for optimised implementation.
-
- Jan 21, 2017
-
-
Paul Sokolovsky authored
If result guaranteedly fits in a small int, it is handled in objint.c. Otherwise, it is delegated to mp_obj_int_from_bytes_impl(), which should be implemented by individual objint_*.c, similar to mp_obj_int_to_bytes_impl().
-
- Dec 21, 2016
-
-
Damien George authored
And also simplify it to remove the check for small int. This can be done because this function is only ever called if the argument is not a small int.
-
- Oct 11, 2016
-
-
Damien George authored
-
Damien George authored
-
- Jan 07, 2016
-
-
Damien George authored
This function returns the sign (-1, 0 or 1) of the integer object.
-
- Apr 25, 2015
-
-
Damien George authored
This gets int.to_bytes working for bignum, and also struct.pack with 'q' and 'Q' args on 32-bit machines. Addresses issue #1155.
-
- Apr 16, 2015
-
-
Damien George authored
Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
-
- Mar 14, 2015
-
-
Damien George authored
-
- Jan 24, 2015
-
-
David Steinberg authored
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Oct 03, 2014
-
-
Damien George authored
Addressing issue #50.
-
- Sep 15, 2014
-
-
Damien George authored
sys.exit always raises SystemExit so doesn't need a special implementation for each port. If C exit() is really needed, use the standard os._exit function. Also initialise mp_sys_path and mp_sys_argv in teensy port.
-
- Aug 29, 2014
-
-
Damien George authored
Addressing issue #50, still some way to go yet.
-
- Jul 24, 2014
-
-
Damien George authored
Addresses issue #765.
-
- May 17, 2014
-
-
Paul Sokolovsky authored
-
- May 03, 2014
-
-
Damien George authored
Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
-
- Apr 08, 2014
-
-
Damien George authored
With the implementation of proper string formatting, code to print a small int was delegated to mpz_as_str_inpl (after first converting the small int to an mpz using stack memory). But mpz_as_str_inpl allocates heap memory to do the conversion, so small ints needed heap memory just to be printed. This fix has a separate function to print small ints, which does not allocate heap, and allocates less stack. String formatting, printf and pfenv are now large beasts, with some semi-duplicated code.
-
- Apr 07, 2014
-
-
Dave Hylands authored
-
- Apr 04, 2014
-
-
Damien George authored
-
- Feb 22, 2014
-
-
Damien George authored
Some functionality is still missing (eg and, or, bit shift), and some things are buggy (eg subtract).
-
- Feb 15, 2014
-
-
Damien George authored
-
Damien George authored
-
- Feb 14, 2014
-
-
Paul Sokolovsky authored
Done by introducing another factored out helper API in binary.c. This API can be reused also by array and struct modules.
-
- Jan 27, 2014
-
-
Paul Sokolovsky authored
-
- Jan 15, 2014
-
-
Paul Sokolovsky authored
-
- Jan 13, 2014
-
-
Paul Sokolovsky authored
-