diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2009-02-14 22:55:32 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2009-02-14 22:55:32 +0000 |
commit | f1f3155ef6f28fb8595920e5423336b39bba4ed0 (patch) | |
tree | f7016ea23c888285ac255d06a42a7205ecca48fe /src/utils/utils.c | |
parent | d0d70a21234ce34ab606c403cdb205897ace0cbb (diff) | |
download | libcss-f1f3155ef6f28fb8595920e5423336b39bba4ed0.tar.gz libcss-f1f3155ef6f28fb8595920e5423336b39bba4ed0.tar.bz2 |
Port libcss to libwapcaplet.
It passes the tests, perhaps we need more of them.
Lifetimes of lwc_string objects really need attention before we can consider
this finished.
svn path=/trunk/libcss/; revision=6517
Diffstat (limited to 'src/utils/utils.c')
-rw-r--r-- | src/utils/utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/utils.c b/src/utils/utils.c index a8d0cb5..29c7ec1 100644 --- a/src/utils/utils.c +++ b/src/utils/utils.c @@ -7,7 +7,7 @@ #include "utils/utils.h" -css_fixed number_from_css_string(const css_string *string, +css_fixed number_from_lwc_string(lwc_string *string, bool int_only, size_t *consumed) { size_t len; @@ -17,11 +17,11 @@ css_fixed number_from_css_string(const css_string *string, int32_t fracpart = 0; int32_t pwr = 1; - if (string == NULL || string->len == 0 || consumed == NULL) + if (string == NULL || lwc_string_length(string) == 0 || consumed == NULL) return 0; - len = string->len; - ptr = string->data; + len = lwc_string_length(string); + ptr = (uint8_t *)lwc_string_data(string); /* number = [+-]? ([0-9]+ | [0-9]* '.' [0-9]+) */ @@ -91,7 +91,7 @@ css_fixed number_from_css_string(const css_string *string, } } - *consumed = ptr - string->data; + *consumed = (char *)ptr - lwc_string_data(string); if (sign > 0) { /* If the result is larger than we can represent, |