Optimize cl-struct-slot-value; fix test
[bpt/emacs.git] / lwlib / lwlib-Xm.c
index 2b7677a..bbb9657 100644 (file)
@@ -1,6 +1,6 @@
 /* The lwlib interface to Motif widgets.
 
 /* The lwlib interface to Motif widgets.
 
-Copyright (C) 1994-1997, 1999-201 Free Software Foundation, Inc.
+Copyright (C) 1994-1997, 1999-2014 Free Software Foundation, Inc.
 Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
 Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
@@ -16,13 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
 #include <config.h>
-#endif
 
 #include <unistd.h>
 #include <stdio.h>
 
 #include <unistd.h>
 #include <stdio.h>
@@ -186,9 +182,9 @@ make_destroyed_instance (char* name,
 static void
 free_destroyed_instance (destroyed_instance* instance)
 {
 static void
 free_destroyed_instance (destroyed_instance* instance)
 {
-  free (instance->name);
-  free (instance->type);
-  free (instance);
+  xfree (instance->name);
+  xfree (instance->type);
+  xfree (instance);
 }
 
 \f/* motif utility functions */
 }
 
 \f/* motif utility functions */
@@ -492,7 +488,6 @@ make_menu_in_widget (widget_instance* instance,
   int child_index;
   widget_value* cur;
   Widget button = 0;
   int child_index;
   widget_value* cur;
   Widget button = 0;
-  Widget title = 0;
   Widget menu;
   Arg al [256];
   int ac;
   Widget menu;
   Arg al [256];
   int ac;
@@ -556,7 +551,7 @@ make_menu_in_widget (widget_instance* instance,
        {
          ac = 0;
          XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
        {
          ac = 0;
          XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
-         title = button = XmCreateLabel (widget, cur->name, al, ac);
+         button = XmCreateLabel (widget, cur->name, al, ac);
        }
       else if (lw_separator_p (cur->name, &separator, 1))
        {
        }
       else if (lw_separator_p (cur->name, &separator, 1))
        {
@@ -928,13 +923,13 @@ xm_update_one_value (widget_instance* instance,
     }
   else if (class == xmTextWidgetClass)
     {
     }
   else if (class == xmTextWidgetClass)
     {
-      free (val->value);
+      xfree (val->value);
       val->value = XmTextGetString (widget);
       val->edited = True;
     }
   else if (class == xmTextFieldWidgetClass)
     {
       val->value = XmTextGetString (widget);
       val->edited = True;
     }
   else if (class == xmTextFieldWidgetClass)
     {
-      free (val->value);
+      xfree (val->value);
       val->value = XmTextFieldGetString (widget);
       val->edited = True;
     }
       val->value = XmTextFieldGetString (widget);
       val->edited = True;
     }
@@ -959,7 +954,7 @@ xm_update_one_value (widget_instance* instance,
              XtVaGetValues (toggle, XmNset, &set, NULL);
              if (set)
                {
              XtVaGetValues (toggle, XmNset, &set, NULL);
              if (set)
                {
-                 free (val->value);
+                 xfree (val->value);
                  val->value = safe_strdup (XtName (toggle));
                }
            }
                  val->value = safe_strdup (XtName (toggle));
                }
            }