[Liboil-commit] 2 commits - examples/orc liboil/c liboil/conv liboil/dct liboil/jpeg liboil/liboilcpu-x86.c liboil/liboiltest.c liboil/liboilutils.c

David Schleef ds at kemper.freedesktop.org
Thu May 29 14:02:40 PDT 2008


 examples/orc/Makefile.am    |    4 ++--
 liboil/c/copy.c             |    2 ++
 liboil/c/swab.c             |    2 ++
 liboil/conv/conv_bitstuff.c |    2 +-
 liboil/conv/conv_misc.c     |    2 +-
 liboil/dct/dct.h            |    4 ++++
 liboil/dct/idct8x8_c.c      |    6 +++---
 liboil/jpeg/convert8x8_c.c  |   10 +++++-----
 liboil/jpeg/quantize8x8_c.c |    2 +-
 liboil/liboilcpu-x86.c      |    8 ++++++++
 liboil/liboiltest.c         |    3 ++-
 liboil/liboilutils.c        |    2 ++
 12 files changed, 33 insertions(+), 14 deletions(-)

New commits:
commit 8304de0c341d3e79799c0e6c00dafe62bbf079e0
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Thu May 29 13:59:09 2008 -0700

    [oil] Compile fixes for windows

diff --git a/liboil/c/copy.c b/liboil/c/copy.c
index c10f7f1..4ed6e7d 100644
--- a/liboil/c/copy.c
+++ b/liboil/c/copy.c
@@ -33,7 +33,9 @@
 #include <liboil/liboilfunction.h>
 #include <liboil/liboilclasses.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 
 static void
diff --git a/liboil/c/swab.c b/liboil/c/swab.c
index dac86b0..c32fbc9 100644
--- a/liboil/c/swab.c
+++ b/liboil/c/swab.c
@@ -33,7 +33,9 @@
 #include <liboil/liboilfunction.h>
 #include <liboil/liboilclasses.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <string.h>
 
 
diff --git a/liboil/conv/conv_bitstuff.c b/liboil/conv/conv_bitstuff.c
index a962f92..944a1fc 100644
--- a/liboil/conv/conv_bitstuff.c
+++ b/liboil/conv/conv_bitstuff.c
@@ -29,7 +29,7 @@
 #include "config.h"
 #endif
 #include <liboil/liboilfunction.h>
-#include <conv.h>
+#include "conv.h"
 
 #ifdef HAVE_IEEE754_H
 
diff --git a/liboil/conv/conv_misc.c b/liboil/conv/conv_misc.c
index 6c46560..bf77404 100644
--- a/liboil/conv/conv_misc.c
+++ b/liboil/conv/conv_misc.c
@@ -29,7 +29,7 @@
 #include "config.h"
 #endif
 #include <liboil/liboilfunction.h>
-#include <conv.h>
+#include "conv.h"
 
 #include <math.h>
 
diff --git a/liboil/dct/dct.h b/liboil/dct/dct.h
index da4cd25..3d7be3c 100644
--- a/liboil/dct/dct.h
+++ b/liboil/dct/dct.h
@@ -30,6 +30,10 @@
 
 #include <liboil/liboilfunction.h>
 
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
 OIL_DECLARE_CLASS(dct12_f32);
 OIL_DECLARE_CLASS(dct36_f32);
 OIL_DECLARE_CLASS(fdct8_f64);
diff --git a/liboil/dct/idct8x8_c.c b/liboil/dct/idct8x8_c.c
index 078d78d..673a7c4 100644
--- a/liboil/dct/idct8x8_c.c
+++ b/liboil/dct/idct8x8_c.c
@@ -43,13 +43,13 @@
  */
 
 #define BLOCK8x8_F64(ptr, stride, row, column) \
-	(*((double *)((void *)ptr + stride*row) + column))
+	(*((double *)((unsigned char *)ptr + stride*row) + column))
 
 #define BLOCK8x8_PTR_F64(ptr, stride, row, column) \
-	((double *)((void *)ptr + stride*row) + column)
+	((double *)((unsigned char *)ptr + stride*row) + column)
 
 #define BLOCK8x8_S16(ptr, stride, row, column) \
-	(*((int16_t *)((void *)ptr + stride*row) + column))
+	(*((int16_t *)((unsigned char *)ptr + stride*row) + column))
 
 static void
 idct8x8_test (OilTest *test)
diff --git a/liboil/jpeg/convert8x8_c.c b/liboil/jpeg/convert8x8_c.c
index 496aa95..23bcae6 100644
--- a/liboil/jpeg/convert8x8_c.c
+++ b/liboil/jpeg/convert8x8_c.c
@@ -74,16 +74,16 @@ OIL_DEFINE_CLASS (clipconv8x8_u8_s16,
     "uint8_t * d_8x8, int dstr, int16_t * s_8x8, int sstr");
 
 #define BLOCK8x8_F64(ptr, stride, row, column) \
-	(*((double *)((void *)ptr + stride*row) + column))
+	(*((double *)((unsigned char *)ptr + stride*row) + column))
 
 #define BLOCK8x8_PTR_F64(ptr, stride, row, column) \
-	((double *)((void *)ptr + stride*row) + column)
+	((double *)((unsigned char *)ptr + stride*row) + column)
 
 #define BLOCK8x8_S16(ptr, stride, row, column) \
-	(*((int16_t *)((void *)ptr + stride*row) + column))
+	(*((int16_t *)((unsigned char *)ptr + stride*row) + column))
 
 #define BLOCK8x8_U8(ptr, stride, row, column) \
-	(*((uint8_t *)((void *)ptr + stride*row) + column))
+	(*((uint8_t *)((unsigned char *)ptr + stride*row) + column))
 
 
 static void
@@ -93,7 +93,7 @@ conv8x8_s16_f64_c (int16_t * dest, int dstr, double *src, int sstr)
 
   for (i = 0; i < 8; i++) {
     for (j = 0; j < 8; j++) {
-      BLOCK8x8_S16 (dest, dstr, i, j) = rint (BLOCK8x8_F64 (src, sstr, i, j));
+      BLOCK8x8_S16 (dest, dstr, i, j) = floor (0.5 + BLOCK8x8_F64 (src, sstr, i, j));
     }
   }
 }
diff --git a/liboil/jpeg/quantize8x8_c.c b/liboil/jpeg/quantize8x8_c.c
index 7f8e03c..949f066 100644
--- a/liboil/jpeg/quantize8x8_c.c
+++ b/liboil/jpeg/quantize8x8_c.c
@@ -48,7 +48,7 @@ OIL_DEFINE_CLASS (dequantize8x8_s16,
     "int16_t *s2_8x8, int sstr2");
 
 #define BLOCK8x8_S16(ptr, stride, row, column) \
-	(*((int16_t *)((void *)ptr + stride*row) + column))
+	(*((int16_t *)((unsigned char *)ptr + stride*row) + column))
 
 static void
 dequantize8x8_s16_ref (int16_t *dest, int dstr, int16_t *src, int sstr,
diff --git a/liboil/liboilcpu-x86.c b/liboil/liboilcpu-x86.c
index ebddc93..56f7790 100644
--- a/liboil/liboilcpu-x86.c
+++ b/liboil/liboilcpu-x86.c
@@ -34,14 +34,18 @@
 #include <liboil/liboilfault.h>
 #include <liboil/liboilutils.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <setjmp.h>
 #include <signal.h>
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 #include <time.h>
 
 #if defined(__FreeBSD__) || defined(__APPLE__)
@@ -129,6 +133,7 @@ oil_cpu_i386_getflags_cpuinfo (char *cpuinfo)
 }
 #endif
 
+#ifdef HAVE_GCC_ASM
 static unsigned long
 oil_profile_stamp_rdtsc(void)
 {
@@ -136,6 +141,7 @@ oil_profile_stamp_rdtsc(void)
 	__asm__ __volatile__("rdtsc\n" : "=a" (ts) : : "edx");
 	return ts;
 }
+#endif
 
 #ifdef USE_I386_CPUID
 #ifdef __i386__
@@ -201,9 +207,11 @@ oil_cpu_detect_cpuid (void)
 
   get_cpuid (0x00000001, &eax, &ebx, &ecx, &edx);
 
+#ifdef HAVE_GCC_ASM
   if (edx & (1<<4)) {
     _oil_profile_stamp = oil_profile_stamp_rdtsc;
   }
+#endif
 
   /* Intel flags */
   if (edx & (1<<15)) {
diff --git a/liboil/liboiltest.c b/liboil/liboiltest.c
index b4c6e5d..43bcde2 100644
--- a/liboil/liboiltest.c
+++ b/liboil/liboiltest.c
@@ -671,7 +671,8 @@ check_holes (void *data, OilType type, int pre_n, int stride, int post_n,
   }
 
   for(i=0;i<post_n;i++){
-    if (!check_guard (data + stride * i + chunk_size, hole_size, guard)) {
+    if (!check_guard (OIL_OFFSET(data, stride * i + chunk_size),
+        hole_size, guard)) {
       return 0;
     }
   }
diff --git a/liboil/liboilutils.c b/liboil/liboilutils.c
index 0d7cc15..faa70ce 100644
--- a/liboil/liboilutils.c
+++ b/liboil/liboilutils.c
@@ -32,7 +32,9 @@
 #include <liboil/liboildebug.h>
 #include <liboil/liboilutils.h>
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
commit 74128fd0b3f857ed06411a1f6fd0a17907382db7
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Thu May 29 13:57:08 2008 -0700

    [orc] glib isn't used, so remove it from libs/cflags

diff --git a/examples/orc/Makefile.am b/examples/orc/Makefile.am
index 9023579..c91a3d8 100644
--- a/examples/orc/Makefile.am
+++ b/examples/orc/Makefile.am
@@ -1,8 +1,8 @@
 
 noinst_PROGRAMS = jit simple
 
-AM_LDFLAGS = $(ORC_LIBS) $(GLIB_LIBS)
-AM_CFLAGS = $(ORC_CFLAGS) $(GLIB_CFLAGS)
+AM_LDFLAGS = $(ORC_LIBS)
+AM_CFLAGS = $(ORC_CFLAGS)
 
 jit_SOURCES = jit.c
 


More information about the Liboil-commit mailing list