From c1419b43ea354fa04360450ae4f64612df065099 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 14 Nov 2005 21:59:09 +0000 Subject: these pragmas are only used for MSVC, not MinGW or Cygwin, therefore changing the define from NT to _MSC_VER svn path=/trunk/externals/ggee/; revision=3903 --- control/serialize.c | 116 ++++++++++++++++++++++++++-------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'control/serialize.c') diff --git a/control/serialize.c b/control/serialize.c index d288ec4..961a32d 100755 --- a/control/serialize.c +++ b/control/serialize.c @@ -1,58 +1,58 @@ -/* (C) Guenter Geiger */ - - -#include -#ifdef NT -#pragma warning( disable : 4244 ) -#pragma warning( disable : 4305 ) -#endif - -/* ------------------------ serialize ----------------------------- */ - -#define MAX_ELEMENTS 256 - -static t_class *serialize_class; - - -typedef struct _serialize -{ - t_object x_obj; - t_atom x_abuf[MAX_ELEMENTS]; - t_int x_count; - t_float x_elements; -} t_serialize; - - -void serialize_float(t_serialize *x,t_floatarg f) -{ - SETFLOAT(&x->x_abuf[x->x_count],f); - x->x_count++; - - if (x->x_count == x->x_elements) { - outlet_list(x->x_obj.ob_outlet,0,x->x_count,x->x_abuf); - x->x_count = 0; - } -} - - -static void *serialize_new(t_floatarg f) -{ - t_serialize *x = (t_serialize *)pd_new(serialize_class); - outlet_new(&x->x_obj,&s_float); - x->x_elements = f; - x->x_count=0; - if ((f <= 0) || (f > MAX_ELEMENTS)) x->x_elements = 1; - floatinlet_new(&x->x_obj, &x->x_elements); - return (x); -} - - - -void serialize_setup(void) -{ - serialize_class = class_new(gensym("serialize"), (t_newmethod)serialize_new, 0, - sizeof(t_serialize),0, A_DEFFLOAT,0); - class_addfloat(serialize_class,serialize_float); -} - - +/* (C) Guenter Geiger */ + + +#include +#ifdef _MSC_VER +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#endif + +/* ------------------------ serialize ----------------------------- */ + +#define MAX_ELEMENTS 256 + +static t_class *serialize_class; + + +typedef struct _serialize +{ + t_object x_obj; + t_atom x_abuf[MAX_ELEMENTS]; + t_int x_count; + t_float x_elements; +} t_serialize; + + +void serialize_float(t_serialize *x,t_floatarg f) +{ + SETFLOAT(&x->x_abuf[x->x_count],f); + x->x_count++; + + if (x->x_count == x->x_elements) { + outlet_list(x->x_obj.ob_outlet,0,x->x_count,x->x_abuf); + x->x_count = 0; + } +} + + +static void *serialize_new(t_floatarg f) +{ + t_serialize *x = (t_serialize *)pd_new(serialize_class); + outlet_new(&x->x_obj,&s_float); + x->x_elements = f; + x->x_count=0; + if ((f <= 0) || (f > MAX_ELEMENTS)) x->x_elements = 1; + floatinlet_new(&x->x_obj, &x->x_elements); + return (x); +} + + + +void serialize_setup(void) +{ + serialize_class = class_new(gensym("serialize"), (t_newmethod)serialize_new, 0, + sizeof(t_serialize),0, A_DEFFLOAT,0); + class_addfloat(serialize_class,serialize_float); +} + + -- cgit v1.2.1