[PD-cvs] pd/src desire.c,1.1.2.217.2.164,1.1.2.217.2.165

Mathieu Bouchard matju at users.sourceforge.net
Wed Jul 18 21:07:27 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4124

Modified Files:
      Tag: desiredata
	desire.c 
Log Message:
removed some MAXPDSTRING; fixed Find Last Error


Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.164
retrieving revision 1.1.2.217.2.165
diff -C2 -d -r1.1.2.217.2.164 -r1.1.2.217.2.165
*** desire.c	18 Jul 2007 18:36:52 -0000	1.1.2.217.2.164
--- desire.c	18 Jul 2007 19:07:23 -0000	1.1.2.217.2.165
***************
*** 5539,5547 ****
  static void message_adddollsym(t_message *x, t_symbol *s) {
      t_atom a;
!     char buf[MAXPDSTRING];
!     buf[0] = '$';
!     strncpy(buf+1, s->name, MAXPDSTRING-2);
!     buf[MAXPDSTRING-1] = 0;
!     SETDOLLSYM(&a, gensym(buf));
      binbuf_add(x->binbuf, 1, &a);
      gobj_changed(x,"binbuf");
--- 5539,5543 ----
  static void message_adddollsym(t_message *x, t_symbol *s) {
      t_atom a;
!     SETDOLLSYM(&a, symprintf("$%s",s->name));
      binbuf_add(x->binbuf, 1, &a);
      gobj_changed(x,"binbuf");
***************
*** 5801,5808 ****
  static void canvas_object_help(t_canvas *x, t_symbol *name) {
  	t_text *o = symbol2opointer(name); if (!o) return;
!         char namebuf[MAXPDSTRING], *dir;
          t_class *c = o->_class;
          strcpy(namebuf, class_gethelpname(c));
!         dir = c->externdir->name;
          if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
          open_via_helppath(namebuf, dir);
--- 5797,5804 ----
  static void canvas_object_help(t_canvas *x, t_symbol *name) {
  	t_text *o = symbol2opointer(name); if (!o) return;
!         char namebuf[MAXPDSTRING];
          t_class *c = o->_class;
          strcpy(namebuf, class_gethelpname(c));
!         char *dir = c->externdir->name;
          if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
          open_via_helppath(namebuf, dir);
***************
*** 7264,7268 ****
  
  static void openit(const char *dirname, const char *filename) {
!     char dirbuf[MAXPDSTRING], *nameptr;
      int fd = open_via_path(dirname,filename,"",dirbuf,&nameptr,MAXPDSTRING,0);
      if (fd) {
--- 7260,7265 ----
  
  static void openit(const char *dirname, const char *filename) {
!     char dirbuf[MAXPDSTRING];
!     char *nameptr;
      int fd = open_via_path(dirname,filename,"",dirbuf,&nameptr,MAXPDSTRING,0);
      if (fd) {
***************
*** 7473,7486 ****
  
  static t_pd *error_object;
! static char error_string[MAXPDSTRING];
  void canvas_finderror(void *object);
  
  void verror(const char *fmt, va_list ap) {
!     char *buf;
      dopost("error: ");
!     vasprintf(&buf,fmt,ap);
!     strcat(buf, "\n");
!     dopost(buf);
!     free(buf);
      error_object = pd_stackn ? pd_stack[pd_stackn-1].self : 0;
  }
--- 7470,7482 ----
  
  static t_pd *error_object;
! static char *error_string;
  void canvas_finderror(void *object);
  
  void verror(const char *fmt, va_list ap) {
!     if (error_string) free(error_string);
      dopost("error: ");
!     vasprintf(&error_string,fmt,ap);
!     dopost(error_string);
!     dopost("\n");
      error_object = pd_stackn ? pd_stack[pd_stackn-1].self : 0;
  }
***************
*** 7502,7514 ****
  }
  
- /* this proc is a big bug (hint: error string is uninitialized _and_ never initialized).
- who did this? what is it supposed to be? */
  extern "C" void glob_finderror(t_pd *dummy) {
!     if (!error_object) post("no findable error yet.");
!     else {
!         post("last trackable error was for object x%lx: %s", error_object, error_string);
! 	sys_mgui(error_object,"show_error","S",error_string);
!         canvas_finderror(error_object);
!     }
  }
  
--- 7498,7506 ----
  }
  
  extern "C" void glob_finderror(t_pd *dummy) {
!     if (!error_object) {post("no findable error yet."); return;}
!     post("last trackable error was for object x%lx: %s", error_object, error_string);
!     sys_mgui(error_object,"show_error","S",error_string);
!     canvas_finderror(error_object);
  }
  





More information about the Pd-cvs mailing list