13 Commits

Author SHA1 Message Date
David Carlier
a2cc07cad4 Fix non Linux build.
timezone global is a linux-ism whereas it is a function under BSD.
Here a helper to get the timezone value in a more portable manner.
2018-10-26 14:02:09 +00:00
Guy Benoish
3ee8be85bf enlarged buffer given to ld2string 2017-01-11 19:24:19 +02:00
antirez
12a4348a7c Fix HINCRBYFLOAT to work with long doubles.
During the refactoring needed for lazy free, specifically the conversion
of t_hash from struct robj to plain SDS strings, HINCRBFLOAT was
accidentally moved away from long doubles to doubles for internal
processing of increments and formatting.

The diminished precision created more obvious artifacts in the way small
numbers are formatted once we convert from decimal number in radix 10 to
double and back to its string in radix 10.

By using more precision, we now have less surprising results at least
with small numbers like "1.23", exactly like in the previous versions of
Redis.

See issue #2846.
2015-11-04 17:16:34 +01:00
antirez
5ae12b50d1 Lazyfree: Hash converted to use plain SDS WIP 2. 2015-10-01 13:02:24 +02:00
antirez
5fd01e29d9 Lazyfree: Hash converted to use plain SDS WIP 1. 2015-10-01 13:02:24 +02:00
antirez
21bba043d0 Utils: Include stdint.h and fix signess in sdigits10(). 2015-02-27 16:03:02 +01:00
antirez
b3d03d79d6 Utils: added function to get radix 10 string length of signed integer. 2015-02-27 15:22:10 +01:00
Matt Stancliff
d2356d1ce7 Allow all code tests to run using Redis args
Previously, many files had individual main() functions for testing,
but each required being compiled with their own testing flags.
That gets difficult when you have 8 different flags you need
to set just to run all tests (plus, some test files required
other files to be compiled aaginst them, and it seems some didn't
build at all without including the rest of Redis).

Now all individual test main() funcions are renamed to a test
function for the file itself and one global REDIS_TEST define enables
testing across the entire codebase.

Tests can now be run with:
  - `./redis-server test <test>`

  e.g. ./redis-server test ziplist

If REDIS_TEST is not defined, then no tests get included and no
tests are included in the final redis-server binary.
2014-12-23 09:31:03 -05:00
antirez
0726c25900 pathIsBaseName() added to utils.c
The function is used to test that the specified string looks like just
as the basename of a path, without any absolute or relative path.
2013-07-02 12:08:07 +02:00
antirez
f57a871de0 getAbsolutePath() moved into utils.c 2013-07-02 11:56:52 +02:00
antirez
a32d1ddff6 BSD license added to every C source and header file. 2012-11-08 18:31:32 +01:00
Pieter Noordhuis
46b9b4b468 string2* functions take a const pointer 2012-01-02 15:24:50 -08:00
Pieter Noordhuis
6ba75861f8 Tests for string2ll; move isObject* to object.c 2011-05-05 16:26:50 +02:00