diff -ur work/xwave2-981109/src-orig/aifc.c work/xwave2-981109/src/aifc.c
--- work/xwave2-981109/src-orig/aifc.c	2009-08-07 10:10:25.000000000 +0900
+++ work/xwave2-981109/src/aifc.c	2009-08-05 16:03:48.000000000 +0900
@@ -49,7 +49,7 @@
    int i,count;
    Aif_Form form;
    Aif_Chunk chunk;
-   ulong frames,stamp,block_size,offset;
+   unsigned int frames,stamp,block_size,offset;
    short channels,bps;
    ID comp_typ;
    unsigned char freq[10],plength,*pstring;
@@ -177,7 +177,7 @@
    Com_Chunk com;
    int headoffs=0;
    char freq[10];
-   ulong stamp,offset,block_size;
+   unsigned int stamp,offset,block_size;
    int i;
 
    com.channels=af->channels;
diff -ur work/xwave2-981109/src-orig/aifc.h work/xwave2-981109/src/aifc.h
--- work/xwave2-981109/src-orig/aifc.h	1998-11-09 08:22:55.000000000 +0900
+++ work/xwave2-981109/src/aifc.h	2009-08-05 16:05:23.000000000 +0900
@@ -13,18 +13,18 @@
 
 typedef struct {
    ID form;
-   long length;
+   int length;
    ID type;
 } Aif_Form;
 
 typedef struct {
    ID type;
-   long length;
+   int length;
 } Aif_Chunk;
 
 typedef struct {
    short channels;
-   unsigned long s_frames;
+   unsigned int s_frames;
    short bps;
    double freq;
    ID comp_typ;
diff -ur work/xwave2-981109/src-orig/audio.c work/xwave2-981109/src/audio.c
--- work/xwave2-981109/src-orig/audio.c	2009-08-07 10:10:25.000000000 +0900
+++ work/xwave2-981109/src/audio.c	2009-08-05 15:46:02.000000000 +0900
@@ -173,7 +173,7 @@
 {
     ALconfig config=ALnewconfig();
     ALport port=0;
-    long pvbuf[2];
+    int pvbuf[2];
     
     switch (AU_RES) {
      case 8: 
@@ -212,7 +212,7 @@
 {
     ALconfig config=ALnewconfig();
     ALport port=0;
-    long pvbuf[2];
+    int pvbuf[2];
     
     switch (res) {
      case 8: 
diff -ur work/xwave2-981109/src-orig/menu.c work/xwave2-981109/src/menu.c
--- work/xwave2-981109/src-orig/menu.c	1998-11-09 08:22:55.000000000 +0900
+++ work/xwave2-981109/src/menu.c	2009-08-05 15:48:41.000000000 +0900
@@ -171,6 +171,8 @@
     if (from>CM_ALL) from=CM_ALL;
     
     for (i=from;i<=to;i++) {
+		if (i >= CM_ALL)
+			break;
 	XtVaSetValues(cm_widgets[i],XtNsensitive,state,NULL);
     }
 }
diff -ur work/xwave2-981109/src-orig/misc.c work/xwave2-981109/src/misc.c
--- work/xwave2-981109/src-orig/misc.c	1998-11-09 08:22:55.000000000 +0900
+++ work/xwave2-981109/src/misc.c	2009-08-05 08:48:22.000000000 +0900
@@ -109,7 +109,7 @@
 
 int lcm(int a, int b)
 {
-    return ((long)a * (long)b) / (long)gcd(a, b);
+    return ((int)a * (int)b) / (int)gcd(a, b);
 }
 
 void wd2af(Wave_Data *wd,Audio_File *af)
diff -ur work/xwave2-981109/src-orig/record_dialog.c work/xwave2-981109/src/record_dialog.c
--- work/xwave2-981109/src-orig/record_dialog.c	2009-08-07 10:10:25.000000000 +0900
+++ work/xwave2-981109/src/record_dialog.c	2009-08-04 17:34:52.000000000 +0900
@@ -91,7 +91,7 @@
 static byte res,mode;
 static int freq,count=0;
 static char *fname=NULL;
-static long start_clock;
+static int start_clock;
 static int pid=-1;
 static GC gcl,gcr;
 static Display *dpy;
@@ -515,12 +515,12 @@
 Boolean update_record(XtPointer client_data)
 {
     double recordtime;
-    long playsize;
+    int playsize;
 #define ADD_CLOCK 90000
     
     start_clock+=ADD_CLOCK;
     recordtime=(double) start_clock/ONE_SECOND;
-    playsize=(long) (recordtime*(double)(freq*mode*(res/8)));
+    playsize=(int) (recordtime*(double)(freq*mode*(res/8)));
     sprintf(MD->mw->messages,"%.2lf kbytes (%.2lfs)",
 	    (double)playsize/1024,recordtime);
     XtVaSetValues(label5,XtNlabel, MD->mw->messages, NULL);
diff -ur work/xwave2-981109/src-orig/riff.c work/xwave2-981109/src/riff.c
--- work/xwave2-981109/src-orig/riff.c	2009-08-07 10:10:25.000000000 +0900
+++ work/xwave2-981109/src/riff.c	2009-08-05 15:54:01.000000000 +0900
@@ -79,9 +79,9 @@
 {
    RiffHeader rh;
    FmtHeader fh;
-   long chunk;
+   int chunk;
    int headoffs,i;
-   ulong length,slength;
+   unsigned int length,slength;
 
    if (mode==AF_NEW) return(riff_new(af));
    
@@ -112,7 +112,7 @@
       if ((i=read (af->fd,&chunk,sizeof(chunk)))!=sizeof(chunk)) 
 	return(AF_ERROR);
       headoffs+=i;
-      if ((i=read (af->fd,&length,sizeof(ulong)))!=sizeof(ulong)) 
+      if ((i=read (af->fd,&length,sizeof(unsigned int)))!=sizeof(unsigned int)) 
 	return(AF_ERROR);
       headoffs+=i;
       
@@ -172,8 +172,8 @@
 {
    RiffHeader rh;
    FmtHeader fh;
-   long chunk;
-   ulong length,count;
+   int chunk;
+   unsigned int length,count;
 
    length=af->length;
 
diff -ur work/xwave2-981109/src-orig/riff.h work/xwave2-981109/src/riff.h
--- work/xwave2-981109/src-orig/riff.h	1998-11-09 08:22:55.000000000 +0900
+++ work/xwave2-981109/src/riff.h	2009-08-05 15:58:22.000000000 +0900
@@ -17,18 +17,18 @@
 #define RIFF_IDVI_ADPCM 1024
 
 typedef struct {
-   long riff;
-   ulong length;
-   long wave;
+   int riff;
+   unsigned int length;
+   int wave;
 } RiffHeader;
 
 typedef struct {
-   long fmt;
-   ulong chunk_length;
+   int fmt;
+   unsigned int chunk_length;
    short format;
    short modus;
-   ulong freq;
-   ulong bpsec;
+   unsigned int freq;
+   unsigned int bpsec;
    short bpspl;
    short res;
 } FmtHeader;
diff -ur work/xwave2-981109/src-orig/sample_settings.c work/xwave2-981109/src/sample_settings.c
--- work/xwave2-981109/src-orig/sample_settings.c	1998-11-09 08:22:55.000000000 +0900
+++ work/xwave2-981109/src/sample_settings.c	2009-08-04 17:37:26.000000000 +0900
@@ -136,7 +136,7 @@
 
 void ss_ok_CB(Widget w, XtPointer client_data, XtPointer call_data)
 {
-   long choice;
+   int choice;
    Display *dpy=XtDisplay(w);
    Widget popup=(Widget) client_data;
    Sample_Return *sr;
@@ -166,7 +166,7 @@
 
 void res_CB(Widget w, XtPointer client_data,XtPointer call_data)
 {
-   long choice;
+   int choice;
    XtVaGetValues(w, XtNselection, &choice, NULL);
    if (choice && (!MD->mb->canplay16bit))  {
       warn_popup(w,app_resources.err_16bit);
@@ -176,7 +176,7 @@
 
 void chn_CB(Widget w, XtPointer client_data,XtPointer call_data)
 {
-   long choice1,choice2;
+   int choice1,choice2;
    Widget frq=(Widget) client_data;
    
    XtVaGetValues(w, XtNselection, &choice1, NULL);
@@ -196,7 +196,7 @@
 
 void frq_CB(Widget w, XtPointer client_data,XtPointer call_data)
 {
-   long choice1,choice2;
+   int choice1,choice2;
    Widget chn=(Widget) client_data;
 
    XtVaGetValues(w, XtNselection, &choice1, NULL);
@@ -369,7 +369,7 @@
 
 void sample_dialog (void (*sample_callback)(Sample_Return *sr),Wave_Data *wd)
 {
-   long choice=0;
+   int choice=0;
    
    sample_return=sample_callback;
    
@@ -403,7 +403,7 @@
 
 void type_CB(Widget w, XtPointer client_data,XtPointer call_data)
 {
-   long choice1,choice2;
+   int choice1,choice2;
    
    XtVaGetValues(ft_rgroup1, XtNselection, &choice1, NULL);
    XtVaGetValues(ft_rgroup2, XtNselection, &choice2, NULL);
@@ -413,7 +413,7 @@
 
 void comp_CB(Widget w, XtPointer client_data,XtPointer call_data)
 {
-   long choice1,choice2;
+   int choice1,choice2;
    
    XtVaGetValues(ft_rgroup1, XtNselection, &choice1, NULL);
    XtVaGetValues(ft_rgroup2, XtNselection, &choice2, NULL);
@@ -423,7 +423,7 @@
 
 void filetype_dialog (void (*filetype_callback)(int type,int comp))
 {
-   long choice1,choice2;
+   int choice1,choice2;
 
    choice1=app_resources.default_ftype;
    if (choice1>AF_MAX_TYPE) choice1=0;
diff -ur work/xwave2-981109/src-orig/types.h work/xwave2-981109/src/types.h
--- work/xwave2-981109/src-orig/types.h	2009-08-07 10:10:25.000000000 +0900
+++ work/xwave2-981109/src/types.h	2009-08-04 18:04:16.000000000 +0900
@@ -52,12 +52,12 @@
     int           peak_r;
     int           ind_peak_l;      /* index (position) of peak */
     int           ind_peak_r;
-    ulong         type;            /* AF_TYPE */
-    ulong         comp;            /* AF_COMP */
-    ulong         oldtype;         /* changed files on hd are saved in raw mode */
-    ulong         oldcomp;         /* later they can saved in original format */
-    byte         *lines_l;         /* points for lines for the main */
-    byte         *lines_r;         /* graphic window (speedup) */
+    unsigned int   type;        /* AF_TYPE */
+    unsigned int   comp;        /* AF_COMP */
+    unsigned int   oldtype;     /* changed files on hd are saved in raw mode */
+    unsigned int   oldcomp;     /* later they can saved in original format */
+    byte         *lines_l;      /* points for lines for the main */
+    byte         *lines_r;      /* graphic window (speedup) */
     bool          inmem;
     bool          ismark;
     bool          isplay;
@@ -70,8 +70,8 @@
     int fd;
     byte bps;
     byte channels;
-    ulong comp;
-    ulong type;
+    unsigned int comp;
+    unsigned int type;
     int freq;
     int length;
     int headoffs;
