~ubuntu-branches/ubuntu/maverick/vice/maverick

« back to all changes in this revision

Viewing changes to src/arch/unix/x11/xaw/uimenu.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-02-01 11:30:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050201113026-3eyakzsmmheclvjg
Tags: 1.16-1
* New upstream version
* Fixes crash on 64-bit architectures (closes: #287640)
* x128 working again (closes: #286767)
* Works fine with /dev/dsp in use (not in the main changelog, but tested
  on my local machine as working).  Presumably, this also takes care of
  the issue with dsp being held.  I'm not sure if this is because I'm
  testing it on a 2.6 kernel now -- if you are still having problems
  with /dev/dsp, please reopen the bugs. (closes: #152952, #207942)
* Don't kill Makefile.in on clean

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
 
77
77
static Widget top_menu;
78
78
 
79
 
/* This keeps a list of the menus with a checkmark on the left.  Each time
80
 
   some setting is changed, we have to update them. */
81
 
#define MAX_UPDATE_MENU_LIST_SIZE 1024
82
 
static Widget checkmark_menu_items[MAX_UPDATE_MENU_LIST_SIZE];
 
79
static Widget *checkmark_menu_items = NULL;
 
80
static int num_checkmark_menu_items_max = 0;
83
81
int num_checkmark_menu_items = 0;
84
82
 
85
83
static Display *my_display;
295
293
                    /* Add this item to the list of calls to perform to update
296
294
                       the menu status. */
297
295
                    if (list[i].callback) {
298
 
                        if (num_checkmark_menu_items
299
 
                            < MAX_UPDATE_MENU_LIST_SIZE)
300
 
                            checkmark_menu_items[num_checkmark_menu_items++]
301
 
                                = new_item;
302
 
                        else {
303
 
                            fprintf(stderr,
304
 
                                    "Maximum number of menus reached!  "
305
 
                                    "Please fix the code.\n");
306
 
                            exit(-1);
 
296
                        if (num_checkmark_menu_items >=
 
297
                            num_checkmark_menu_items_max) {
 
298
                            num_checkmark_menu_items_max += 100;
 
299
                            checkmark_menu_items = lib_realloc(
 
300
                                checkmark_menu_items,
 
301
                                num_checkmark_menu_items_max
 
302
                                * sizeof(Widget));
307
303
                        }
 
304
                        checkmark_menu_items[num_checkmark_menu_items++]
 
305
                            = new_item;
308
306
                    }
309
307
                    j++;
310
308
 
386
384
 
387
385
    for (i = 0; i < num_checkmark_menu_items; i++)
388
386
        XtCallCallbacks(checkmark_menu_items[i],
389
 
                        XtNcallback, (XtPointer) !NULL);
 
387
                        XtNcallback, (XtPointer)!NULL);
390
388
}
391
389
 
392
390
void ui_menu_set_tick(Widget w, int flag)
467
465
    }
468
466
}
469
467
 
 
468
void uimenu_shutdown(void)
 
469
{
 
470
    lib_free(checkmark_menu_items);
 
471
}
 
472