summaryrefslogtreecommitdiff
path: root/test/number.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-14 19:24:40 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-14 19:24:40 +0000
commitca3293e0332bbd9fe63d6cd6bc215f048132bd08 (patch)
tree29065b3081e1df0bbb274dbe8647e6494c76ab64 /test/number.c
parent0068331a1d6989ef523fca0753bd9ad943232cdf (diff)
downloadlibcss-ca3293e0332bbd9fe63d6cd6bc215f048132bd08.tar.gz
libcss-ca3293e0332bbd9fe63d6cd6bc215f048132bd08.tar.bz2
Make fpmath stuff public.
Un-inline string->fixed conversion routine. svn path=/trunk/libcss/; revision=6513
Diffstat (limited to 'test/number.c')
-rw-r--r--test/number.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/number.c b/test/number.c
index bc5ea52..0140ce9 100644
--- a/test/number.c
+++ b/test/number.c
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <string.h>
-#include "libcss/libcss.h"
+#include <libcss/libcss.h>
#include "utils/utils.h"
@@ -23,7 +23,7 @@ typedef struct line_ctx {
static bool handle_line(const char *data, size_t datalen, void *pw);
static void run_test(const uint8_t *data, size_t len,
const char *exp, size_t explen);
-static void print_fixed(char *buf, size_t len, fixed f);
+static void print_css_fixed(char *buf, size_t len, css_fixed f);
int main(int argc, char **argv)
{
@@ -112,7 +112,7 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen)
{
css_string in = { len, (uint8_t *) data };
size_t consumed;
- fixed result;
+ css_fixed result;
char buf[256];
UNUSED(exp);
@@ -120,14 +120,14 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen)
result = number_from_css_string(&in, false, &consumed);
- print_fixed(buf, sizeof(buf), result);
+ print_css_fixed(buf, sizeof(buf), result);
printf("got: %s expected: %.*s\n", buf, (int) explen, exp);
assert(strncmp(buf, exp, explen) == 0);
}
-void print_fixed(char *buf, size_t len, fixed f)
+void print_css_fixed(char *buf, size_t len, css_fixed f)
{
#define ABS(x) (uint32_t)((x) < 0 ? -(x) : (x))
uint32_t uintpart = FIXTOINT(ABS(f));