From aa82236dd093743bd2973f8b61127582aaf6e96f Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 18 Dec 2005 18:57:13 +0000 Subject: lots of MinGW fixes for RC6 svn path=/trunk/externals/unauthorized/; revision=4250 --- sonogram~/sonogram~-joge.c | 2 +- sonogram~/sonogram~-yves.c | 13 +++++-------- sonogram~/sonogram~.c | 31 ++++++++++++++++++------------- 3 files changed, 24 insertions(+), 22 deletions(-) (limited to 'sonogram~') diff --git a/sonogram~/sonogram~-joge.c b/sonogram~/sonogram~-joge.c index 4216c4d..f420698 100644 --- a/sonogram~/sonogram~-joge.c +++ b/sonogram~/sonogram~-joge.c @@ -45,7 +45,7 @@ #include #include #endif -#ifdef NT +#ifdef _WIN32 #define M_PI 3.14159265358979323846 #include "pthread.h" #include diff --git a/sonogram~/sonogram~-yves.c b/sonogram~/sonogram~-yves.c index 59cbeed..d2ce944 100644 --- a/sonogram~/sonogram~-yves.c +++ b/sonogram~/sonogram~-yves.c @@ -42,16 +42,13 @@ #endif #include #include -#ifdef UNIX -#include -#endif -#ifdef NT +#ifdef WIN32 #define random rand +#define usleep(a) _sleep(a/1000) +#include #include -static int usleep (unsigned int us) { - Sleep((long)(us/1000.)); - return 0; -} +#else +#include #endif #include diff --git a/sonogram~/sonogram~.c b/sonogram~/sonogram~.c index fedf88c..75d17e4 100644 --- a/sonogram~/sonogram~.c +++ b/sonogram~/sonogram~.c @@ -46,13 +46,18 @@ #include #include -#ifdef UNIX +#ifdef _WIN32 +#include +#define random rand +#define usleep(a) _sleep(a/1000) +#else #include #endif -#ifdef NT +#include + +#ifndef M_PI #define M_PI 3.14159265358979323846 #endif -#include #include "m_pd.h" #include "m_imp.h" @@ -326,7 +331,7 @@ static void sonogram_update_block(t_sonogram *x, t_glist *glist, t_int bnumber) } for ( i=0; ix_zoom; i++ ) { - sprintf( x->x_guicommand, "SONIMAGE%x put {%s} -to %d 0\n", (unsigned int)x, x->x_gifdata, (bnumber*x->x_zoom)+i ); + sprintf( x->x_guicommand, "SONIMAGE%x put {%s} -to %d 0\n", (unsigned int)x, x->x_gifdata, (int) ((bnumber*x->x_zoom)+i) ); sys_gui( x->x_guicommand ); } @@ -346,7 +351,7 @@ static void sonogram_update_block(t_sonogram *x, t_glist *glist, t_int bnumber) } for ( i=0; ix_zoom; i++ ) { - sprintf( x->x_guicommand, "FAZIMAGE%x put {%s} -to %d 0\n", (unsigned int)x, x->x_gifdata, (bnumber*x->x_zoom)+i ); + sprintf( x->x_guicommand, "FAZIMAGE%x put {%s} -to %d 0\n", (unsigned int)x, x->x_gifdata, (int) ((bnumber*x->x_zoom)+i) ); sys_gui( x->x_guicommand ); } } @@ -377,15 +382,15 @@ static void sonogram_erase_block(t_sonogram *x, t_glist *glist, t_int bnumber ) static void *sonogram_do_update_part(void *tdata) { - t_sonogram *x = (t_sonogram*) tdata; - t_int si; - t_int nbpoints = 0; - t_float percentage = 0, opercentage = 0; - t_canvas *canvas=glist_getcanvas(x->x_glist); - - + t_sonogram *x = (t_sonogram*) tdata; + t_int si; + t_int nbpoints = 0; + t_float percentage = 0, opercentage = 0; + t_canvas *canvas=glist_getcanvas(x->x_glist); + + // loose synchro - usleep( THREAD_SLEEP_TIME ); + usleep( THREAD_SLEEP_TIME ); // check boundaries if ( x->x_updateend > x->x_size-1 ) x->x_updateend = x->x_size-1; -- cgit v1.2.1