From: Paul C. <pw...@sp...> - 2001-02-28 05:54:50
|
On Tue, 27 Feb 2001, Daniel Walker wrote: I haven't actually tried _running_ it yet, but it looks like the merge got most of my stuff, and it still compiles. :) Thanks. There's this little bit of cleanup, as this got included elsewhere. --- src/gui.c 2001/02/27 23:35:31 1.1.2.2 +++ src/gui.c 2001/02/28 04:35:37 @@ -161,13 +161,6 @@ gtk_entry_set_text(GTK_ENTRY(entry_config_search_items), gui_tmp); } -#if 0 -void gui_update_search_reissue_timeout(GtkEntry *entry_search_reissue_timeout) { - g_snprintf(gui_tmp, sizeof(gui_tmp), "%d", search_reissue_timeout); - gtk_entry_set_text(entry_search_reissue_timeout, gui_tmp); -} -#endif - void gui_update_socks_host() { g_snprintf(gui_tmp, sizeof(gui_tmp), "%s", proxy_ip); I also have this (pasted from an xterm) The first one skips checking the rest of the extentions if we couldn't stat() the file. The second computes strlen(sf->file_name) once per matching file, instead of the 3 places it would otherwise be calculated. --- src/share.c 2001/02/27 23:35:31 1.1.2.2 +++ src/share.c 2001/02/28 04:29:01 1.7 @@ -151,7 +151,7 @@ if (stat(full, &file_stat) == -1) { printf("GTK_GNUTELLA: Can't stat %s.", full); - continue; + break; } found = (struct shared_file *)g_malloc0(sizeof(struct shared_file)); @@ -300,20 +300,21 @@ } if (dir_matches || strstr(sf->file_name_lowercase, search)) { + guint32 file_name_len = strlen(sf->file_name); /* Add to calling nodes found list. */ found_data = - g_realloc(found_data, (size + 8 + strlen(sf->file_name) + 2)*sizeof(guchar)); + g_realloc(found_data, (size + 8 + file_name_len + 2)*sizeof(guchar)); WRITE_GUINT32_LE( sf->file_index, &found_data[pos]); WRITE_GUINT32_LE( sf->file_size, &found_data[pos+4]); - memcpy(&found_data[pos + 8], sf->file_name, strlen(sf->file_name)); + strcpy(&found_data[pos + 8], sf->file_name); /* the size of the search results header 8 bytes, plus the string length - NULL, plus two NULL's */ - size += 8 + strlen(sf->file_name) + 2; + size += 8 + file_name_len + 2; pos = size - 2; > Paul Cassella wrote: > > Hm? I don't think I understand your question. Glade currently adds > > things to support.{c,h} (private functions), interface-glade.{c,h} > > (building the gui) which are used by extern.tcl to produce > > interface.{c,h}, and callbacks.{c,h} (the only one that should be modified > > by the user/developer; the callbacks for actions taken on the gui). Is > > that what you meant? > You seemed to indicate that glade puts stubs and prototypes in many > different files. This line from you last post confused me, > "When you add new things to the gui, glade appends the prototypes and > stubs to those files." Ah. I was unclear. > here's a patch for externs.tcl , it brings back the old functionality > when the -glade.* files exist but have no size. This patch looks ok to me, but I would rather either a) include the interface-glade files in CVS, and not have to worry about them not being generated, or b) require glade in order to build the cvs (not the "official" releases though) and thus not include in CVS any files built completely by glade: (interface{-glade,}.{c,h}, support.{c,h}). And so not have to worry about them not being generated. Similarly require automake, and don't ship any files generated from .am files. -- Paul Cassella |