Commit Graph

47 Commits

Author SHA1 Message Date
ksss e3bc81e75e Fix warning shift-negative-value 2016-07-01 22:00:55 +09:00
Yukihiro "Matz" Matsumoto 8f0c1c7d3c mruby-sprintf:fix double negative signs in printf; fix #3148
MRB_INT_MAX does not have corresponding positive integer
2016-04-23 23:50:01 +09:00
Yukihiro "Matz" Matsumoto c5229074bb mruby-sprintf: format specifiers o,u,x,b ignore sign(+); ref #3148 2016-04-23 22:20:11 +09:00
Yukihiro "Matz" Matsumoto 7c82bfa7fe mruby-sprintf to use mrb_int formatting macros; ref #3076 2016-01-07 12:23:17 +09:00
Yukihiro "Matz" Matsumoto 5c405dea3d include changed from by quotes ("") to by brackets (<>); close #3032 2015-11-27 17:48:23 +09:00
Yukihiro "Matz" Matsumoto abc724840e formatting buffer should be bigger for negative dots; ref #3025 2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto f974880563 binary format no longer need to preserve org_v 2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto 996417cabf integer range check was moved to mrb_flo_to_fixnum(); ref #3025 2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto 09abdcb5e8 negative binary format should not be masked by 10bits; ref #3025 2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto 1a9b607a4d binary sprintf should not be restricted by mrb_int size; fix #3025 2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto e35c3aff83 unsigned long may be smaller than mrb_int; use uint64_t instead; fix #2935 2015-09-03 00:14:37 +09:00
Franck Verrot 2588507285 Remove unnecessary backticks.
Dr Markus Kuhn published in 1999 an article [1] explaining in details
why we shouldn't use the ASCII grave accent (0x60) as a left quotation.

Backticks have been used most notably to produce nice-looking LaTeX
documents but it doesn't seem to be an issue on modern platforms and
for the oldest ones, there are workarounds as mentioned by Dr Kuhn.

[1]: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
2015-06-24 13:07:07 +02:00
Yukihiro "Matz" Matsumoto 33e44a612c refactor MACRO to avoid local variable name conflict; ref #2585 2014-09-04 23:59:27 +09:00
cremno fec2c66ea8 get rid of shadowing variables (mrbgems)
Mostly renaming, except that the definition of struct accessor methods
is now done in a new function.
2014-09-04 12:31:52 +02:00
Yukihiro "Matz" Matsumoto 61ce5892cc remove spaces after open parens 2014-07-12 20:36:45 +09:00
Yukihiro "Matz" Matsumoto c3ed6e3d25 use is_a? Array for String#% argument check as the original PR did in #2349 2014-06-04 09:08:22 +09:00
Yukihiro "Matz" Matsumoto 4380f86150 Special treatment for Hashes, not Arrays; ref #2349 2014-06-03 16:33:30 +09:00
Tomoyuki Sahara fe9f3fdd20 add 'String#%'. 2014-06-03 16:31:20 +09:00
cremno 86cfcd20d6 simply use isfinite 2014-05-04 01:50:17 +02:00
take_cheeze b5028421b9 Use mrb_int in mrbgem rest argument getting. 2014-04-25 22:02:10 +09:00
cubicdaiya bf3f45fc70 Use mrb_int instead of int 2014-03-25 22:33:53 +09:00
cubicdaiya 51947f132b Use bool-macro instead of magic-number 2014-03-22 09:55:48 +09:00
take_cheeze c73f8d4def move summary of mrbgems in default gembox to its spec 2014-03-17 00:34:24 +09:00
cremno 1b6a4fb5a2 add MRB_INT_BIT 2014-03-11 20:14:18 +01:00
ksss 54132e4364 make embed string when create literals 2014-03-06 13:47:51 +00:00
ksss 4070b5987a embed small string
use flags 4 for *this object is embed*
use flags 8~64 for *embed string length*
2014-03-06 13:12:08 +00:00
Yukihiro "Matz" Matsumoto 1f134d723c cancel 313f6b; add fallthrough comment 2014-02-28 18:55:30 +09:00
chasonr 5e5ee841a1 Implement sprintf("%c") for UTF-8.
* sprintf("%c") is changed to accept a string for which String#size returns
  1, even if it is longer than one byte, and to convert a Fixnum via
  Fixnum#chr (possibly returning more than one byte).  Thus, if the UTF-8
  gem is in use, a character will be understood as a single UTF-8 character.

* The change to sprintf depends on the implementation of Fixnum#chr added
  to mrbgems/mruby-string-utf8/src/string.c.

This should work with any other gem that implements a multibyte encoding, as
long as it implements String#size and Fixnum#chr as appropriate.
2014-02-26 20:18:26 -05:00
Yukihiro "Matz" Matsumoto 313f6b5997 forget to break in the switch statement 2014-02-27 08:23:32 +09:00
cubicdaiya 94c5a5ee73 use mrb_str_new_lit instead of mrb_str_new for C string literals 2014-02-26 02:23:50 +09:00
cremno bb25d42d0d add missing declaration of mrb_str_format 2014-01-31 01:34:20 +01:00
cremno 18433731ed remove various preprocessor conditionals
- HAVE_IEEEFP_H is nowhere defined or needed at all
- FreeBSD < 4 is unsupported since years
- MSVC workaround (around what exactly?)
2014-01-02 07:33:33 +01:00
Tomoyuki Sahara 116f75a8ce "spec.author" is better for single-author gems.
"spec.author=" expects a String represents a single author.
"spec.authors=" expects an Array which is a list of multiple authors.

http://guides.rubygems.org/specification-reference/
2013-07-23 10:09:24 +09:00
Cremno 8728837478 Visual Studio 2013 support + strtof + inline
- VC12 has better C99 library support due to C++11
- defined strtof for VC11 or older
- define "inline" only if the C compiler is used
2013-06-27 12:18:35 +02:00
Julien Ammous 8057eb935c removed unused variables / assigns never used 2013-05-18 14:13:04 +02:00
Yukihiro "Matz" Matsumoto fad8b1cefa change mrb_warn to get mrb_state and %S formatter 2013-05-10 22:09:02 +09:00
Yukihiro "Matz" Matsumoto 30d580ecbc rename every ARGS_XXX to MRB_ARGS_XXX; ref #1206 2013-04-25 09:47:36 +09:00
Masaki Muranaka c260ef894e Rename mrb_fix2str() to mrb_fixnum_to_str(). This is for naming consistency. 2013-03-29 22:19:26 +09:00
Masaki Muranaka 710f625254 Remove mrb_flt2big() as there is no bignum in the core.
Add new API mrb_flo_to_fixnum(). You can replace mrb_flt2big() to mrb_flo_to_fixnum() with few modifications.
2013-03-29 22:19:26 +09:00
Masaki Muranaka 05ad6902fd Remove API mrb_string_value(). There have mrb_str_to_str() in the core. And mrb_string_value() is no merit to keep using. 2013-03-29 18:01:25 +09:00
Masaki Muranaka a01e968cdb Remove limits.h from numeric.h. Add limits.h to some C files. 2013-03-29 10:06:40 +09:00
Masaki Muranaka 384db0d809 Fix format for new mrb_raisef(). 2013-03-28 21:35:56 +09:00
Yukihiro "Matz" Matsumoto e53628eb9d Merge pull request #984 from monaka/pr-make-mrb_str_new2-obsolete
Remove mrb_str_new2().
2013-03-12 17:25:23 -07:00
Masaki Muranaka 018db2daac Use suitable types for variables. 2013-03-12 21:12:05 +09:00
Masaki Muranaka be506de3fc Remove mrb_str_new2(). Use mrb_str_new_cstr() instead.
Make mrb_str_new_cstr() accept NULL pointer. It generates 0byte strings by NULL pointer.
2013-03-12 17:54:40 +09:00
Masaki Muranaka 97136825e2 Separate Kernel#sprintf support from mruby core. It's moved to mrbgems. 2013-03-04 23:04:39 +09:00
Masaki Muranaka a5bc5b2574 Move src/sprintf to mrbgems/mruby-sprintf/src/ 2013-03-04 22:27:23 +09:00