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/constant.c | 122 ++++++++++++++++++++++++++--------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) (limited to 'control/constant.c') diff --git a/control/constant.c b/control/constant.c index 7e8ccfa..877326b 100755 --- a/control/constant.c +++ b/control/constant.c @@ -1,61 +1,61 @@ -/* (C) Guenter Geiger */ - - -#include -#include -#include -#ifdef NT -#pragma warning( disable : 4244 ) -#pragma warning( disable : 4305 ) -#endif - -/* ------------------------ constant ----------------------------- */ -#ifndef M_PI -#define M_PI 3.141593f -#endif - -static t_class *constant_class; - - -typedef struct _constant -{ - t_object x_obj; - t_float x_constant; -} t_constant; - - -void constant_bang(t_constant *x) -{ - outlet_float(x->x_obj.ob_outlet, x->x_constant); -} - -static void *constant_new(t_symbol* s) -{ - t_constant *x = (t_constant *)pd_new(constant_class); - - if (s == &s_) - x->x_constant = M_PI; - - if (!strcmp(s->s_name,"PI")) - x->x_constant = M_PI; - - if (!strcmp(s->s_name,"TWOPI")) - x->x_constant = 2*M_PI; - - if (!strcmp(s->s_name,"e")) - x->x_constant = exp(1.0); - - - - outlet_new(&x->x_obj, &s_float); - return (x); -} - -void constant_setup(void) -{ - constant_class = class_new(gensym("constant"), (t_newmethod)constant_new, 0, - sizeof(t_constant), 0,0); - class_addbang(constant_class,constant_bang); -} - - +/* (C) Guenter Geiger */ + + +#include +#include +#include +#ifdef _MSC_VER +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#endif + +/* ------------------------ constant ----------------------------- */ +#ifndef M_PI +#define M_PI 3.141593f +#endif + +static t_class *constant_class; + + +typedef struct _constant +{ + t_object x_obj; + t_float x_constant; +} t_constant; + + +void constant_bang(t_constant *x) +{ + outlet_float(x->x_obj.ob_outlet, x->x_constant); +} + +static void *constant_new(t_symbol* s) +{ + t_constant *x = (t_constant *)pd_new(constant_class); + + if (s == &s_) + x->x_constant = M_PI; + + if (!strcmp(s->s_name,"PI")) + x->x_constant = M_PI; + + if (!strcmp(s->s_name,"TWOPI")) + x->x_constant = 2*M_PI; + + if (!strcmp(s->s_name,"e")) + x->x_constant = exp(1.0); + + + + outlet_new(&x->x_obj, &s_float); + return (x); +} + +void constant_setup(void) +{ + constant_class = class_new(gensym("constant"), (t_newmethod)constant_new, 0, + sizeof(t_constant), 0,0); + class_addbang(constant_class,constant_bang); +} + + -- cgit v1.2.1