mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 17:34:08 +03:00
Expressions rewritten in a more normal way
(double)'0'? :)
This commit is contained in:
parent
5bbfd38dfb
commit
76cc838a93
|
@ -239,7 +239,7 @@ typecast_PYINTERVAL_cast(const char *str, Py_ssize_t len, PyObject *curs)
|
||||||
|
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
case '0': case '1': case '2': case '3': case '4':
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
case '5': case '6': case '7': case '8': case '9':
|
||||||
v = v*10 + (double)*str - (double)'0';
|
v = v * 10.0 + (double)(*str - '0');
|
||||||
if (part == 6){
|
if (part == 6){
|
||||||
denominator *= 10;
|
denominator *= 10;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ typecast_MXINTERVAL_cast(const char *str, Py_ssize_t len, PyObject *curs)
|
||||||
|
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
case '0': case '1': case '2': case '3': case '4':
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
case '5': case '6': case '7': case '8': case '9':
|
||||||
v = v*10 + (double)*str - (double)'0';
|
v = v * 10.0 + (double)(*str - '0');
|
||||||
Dprintf("typecast_MXINTERVAL_cast: v = %f", v);
|
Dprintf("typecast_MXINTERVAL_cast: v = %f", v);
|
||||||
if (part == 6){
|
if (part == 6){
|
||||||
denominator *= 10;
|
denominator *= 10;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user