diff options
Diffstat (limited to 'apps/plugins/pdbox/PDa/src/m_class.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/src/m_class.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/apps/plugins/pdbox/PDa/src/m_class.c b/apps/plugins/pdbox/PDa/src/m_class.c index 66cb34d921..98fe9be23d 100644 --- a/apps/plugins/pdbox/PDa/src/m_class.c +++ b/apps/plugins/pdbox/PDa/src/m_class.c | |||
@@ -2,10 +2,23 @@ | |||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | 2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL |
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | 3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ |
4 | 4 | ||
5 | #if 0 | ||
6 | //#ifdef ROCKBOX | ||
7 | #include "plugin.h" | ||
8 | #include "pdbox.h" | ||
9 | #endif | ||
10 | |||
5 | #define PD_CLASS_DEF | 11 | #define PD_CLASS_DEF |
6 | #include "m_pd.h" | 12 | #include "m_pd.h" |
7 | #include "m_imp.h" | 13 | #include "m_imp.h" |
8 | #include "s_stuff.h" | 14 | #include "s_stuff.h" |
15 | |||
16 | #ifdef ROCKBOX | ||
17 | |||
18 | #include "plugin.h" | ||
19 | #include "pdbox.h" | ||
20 | |||
21 | #else /* ROCKBOX */ | ||
9 | #include <stdlib.h> | 22 | #include <stdlib.h> |
10 | #ifdef UNIX | 23 | #ifdef UNIX |
11 | #include <unistd.h> | 24 | #include <unistd.h> |
@@ -16,6 +29,7 @@ | |||
16 | 29 | ||
17 | #include <stdarg.h> | 30 | #include <stdarg.h> |
18 | #include <string.h> | 31 | #include <string.h> |
32 | #endif /* ROCKBOX */ | ||
19 | 33 | ||
20 | static t_symbol *class_loadsym; /* name under which an extern is invoked */ | 34 | static t_symbol *class_loadsym; /* name under which an extern is invoked */ |
21 | static void pd_defaultfloat(t_pd *x, t_float f); | 35 | static void pd_defaultfloat(t_pd *x, t_float f); |
@@ -27,6 +41,10 @@ static t_symbol *class_extern_dir = &s_; | |||
27 | 41 | ||
28 | static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv) | 42 | static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv) |
29 | { | 43 | { |
44 | #ifdef ROCKBOX | ||
45 | (void) argc; | ||
46 | (void) argv; | ||
47 | #endif | ||
30 | pd_error(x, "%s: no method for '%s'", (*x)->c_name->s_name, s->s_name); | 48 | pd_error(x, "%s: no method for '%s'", (*x)->c_name->s_name, s->s_name); |
31 | } | 49 | } |
32 | 50 | ||
@@ -422,6 +440,10 @@ char *class_gethelpdir(t_class *c) | |||
422 | 440 | ||
423 | static void class_nosavefn(t_gobj *z, t_binbuf *b) | 441 | static void class_nosavefn(t_gobj *z, t_binbuf *b) |
424 | { | 442 | { |
443 | #ifdef ROCKBOX | ||
444 | (void) z; | ||
445 | (void) b; | ||
446 | #endif | ||
425 | bug("save function called but not defined"); | 447 | bug("save function called but not defined"); |
426 | } | 448 | } |
427 | 449 | ||
@@ -465,7 +487,7 @@ t_symbol *dogensym(char *s, t_symbol *oldsym) | |||
465 | s2++; | 487 | s2++; |
466 | } | 488 | } |
467 | sym1 = symhash + (hash2 & (HASHSIZE-1)); | 489 | sym1 = symhash + (hash2 & (HASHSIZE-1)); |
468 | while (sym2 = *sym1) | 490 | while ((sym2 = *sym1)) |
469 | { | 491 | { |
470 | if (!strcmp(sym2->s_name, s)) return(sym2); | 492 | if (!strcmp(sym2->s_name, s)) return(sym2); |
471 | sym1 = &sym2->s_next; | 493 | sym1 = &sym2->s_next; |
@@ -485,10 +507,14 @@ t_symbol *dogensym(char *s, t_symbol *oldsym) | |||
485 | 507 | ||
486 | t_symbol *gensym(char *s) | 508 | t_symbol *gensym(char *s) |
487 | { | 509 | { |
510 | printf("gensym: %s\n", s); | ||
488 | return(dogensym(s, 0)); | 511 | return(dogensym(s, 0)); |
489 | } | 512 | } |
490 | 513 | ||
491 | static t_symbol *addfileextent(t_symbol *s) | 514 | #ifndef ROCKBOX |
515 | static | ||
516 | #endif | ||
517 | t_symbol *addfileextent(t_symbol *s) | ||
492 | { | 518 | { |
493 | char namebuf[MAXPDSTRING], *str = s->s_name; | 519 | char namebuf[MAXPDSTRING], *str = s->s_name; |
494 | int ln = strlen(str); | 520 | int ln = strlen(str); |
@@ -608,7 +634,9 @@ typedef t_pd *(*t_fun6)(t_int i1, t_int i2, t_int i3, t_int i4, t_int i5, t_int | |||
608 | 634 | ||
609 | void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) | 635 | void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) |
610 | { | 636 | { |
637 | #ifndef ROCKBOX | ||
611 | t_method *f; | 638 | t_method *f; |
639 | #endif | ||
612 | t_class *c = *x; | 640 | t_class *c = *x; |
613 | t_methodentry *m; | 641 | t_methodentry *m; |
614 | t_atomtype *wp, wanttype; | 642 | t_atomtype *wp, wanttype; |
@@ -617,7 +645,7 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) | |||
617 | t_floatarg ad[MAXPDARG+1], *dp = ad; | 645 | t_floatarg ad[MAXPDARG+1], *dp = ad; |
618 | int narg = 0; | 646 | int narg = 0; |
619 | t_pd *bonzo; | 647 | t_pd *bonzo; |
620 | 648 | ||
621 | /* check for messages that are handled by fixed slots in the class | 649 | /* check for messages that are handled by fixed slots in the class |
622 | structure. We don't catch "pointer" though so that sending "pointer" | 650 | structure. We don't catch "pointer" though so that sending "pointer" |
623 | to pd_objectmaker doesn't require that we supply a pointer value. */ | 651 | to pd_objectmaker doesn't require that we supply a pointer value. */ |
@@ -658,9 +686,10 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) | |||
658 | else (*((t_messgimme)(m->me_fun)))(x, s, argc, argv); | 686 | else (*((t_messgimme)(m->me_fun)))(x, s, argc, argv); |
659 | return; | 687 | return; |
660 | } | 688 | } |
689 | |||
661 | if (argc > MAXPDARG) argc = MAXPDARG; | 690 | if (argc > MAXPDARG) argc = MAXPDARG; |
662 | if (x != &pd_objectmaker) *(ap++) = (t_int)x, narg++; | 691 | if (x != &pd_objectmaker) *(ap++) = (t_int)x, narg++; |
663 | while (wanttype = *wp++) | 692 | while((wanttype = *wp++)) |
664 | { | 693 | { |
665 | switch (wanttype) | 694 | switch (wanttype) |
666 | { | 695 | { |
@@ -712,6 +741,11 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv) | |||
712 | } | 741 | } |
713 | narg++; | 742 | narg++; |
714 | ap++; | 743 | ap++; |
744 | #ifdef ROCKBOX | ||
745 | break; | ||
746 | default: | ||
747 | break; | ||
748 | #endif | ||
715 | } | 749 | } |
716 | } | 750 | } |
717 | switch (narg) | 751 | switch (narg) |