Mercurial > hg > xemacs-beta
comparison src/device-x.c @ 5204:912c34f1d7c8
(try to) fix g++ compilation problems
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-04-15 Ben Wing <ben@xemacs.org>
* device-x.c (x_init_device):
Don't declare something const if we're going to modify it.
Clean up code to follow GNU coding standards.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Thu, 15 Apr 2010 20:13:25 -0500 |
parents | 97eb4942aec8 |
children | 5efbd1253905 |
comparison
equal
deleted
inserted
replaced
5202:1c615eb1e4b2 | 5204:912c34f1d7c8 |
---|---|
687 does not override resources defined elsewhere */ | 687 does not override resources defined elsewhere */ |
688 const Extbyte *data_dir; | 688 const Extbyte *data_dir; |
689 Extbyte *path; | 689 Extbyte *path; |
690 const Extbyte *format; | 690 const Extbyte *format; |
691 XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */ | 691 XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */ |
692 const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db)); | 692 Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db)); |
693 Extbyte *locale_end; | 693 Extbyte *locale_end; |
694 | 694 |
695 if (STRINGP (Vx_app_defaults_directory) && | 695 if (STRINGP (Vx_app_defaults_directory) && |
696 XSTRING_LENGTH (Vx_app_defaults_directory) > 0) | 696 XSTRING_LENGTH (Vx_app_defaults_directory) > 0) |
697 { | 697 { |
718 | 718 |
719 sprintf (path, format, data_dir, locale); | 719 sprintf (path, format, data_dir, locale); |
720 if (!access (path, R_OK)) | 720 if (!access (path, R_OK)) |
721 XrmCombineFileDatabase (path, &db, False); | 721 XrmCombineFileDatabase (path, &db, False); |
722 | 722 |
723 if ((locale_end = strchr(locale, '.'))) { | 723 if ((locale_end = strchr (locale, '.'))) |
724 *locale_end = '\0'; | 724 { |
725 sprintf (path, format, data_dir, locale); | 725 *locale_end = '\0'; |
726 | 726 sprintf (path, format, data_dir, locale); |
727 if (!access (path, R_OK)) | 727 |
728 XrmCombineFileDatabase (path, &db, False); | 728 if (!access (path, R_OK)) |
729 } | 729 XrmCombineFileDatabase (path, &db, False); |
730 | 730 } |
731 if ((locale_end = strchr(locale, '_'))) { | 731 |
732 *locale_end = '\0'; | 732 if ((locale_end = strchr (locale, '_'))) |
733 sprintf (path, format, data_dir, locale); | 733 { |
734 | 734 *locale_end = '\0'; |
735 if (!access (path, R_OK)) | 735 sprintf (path, format, data_dir, locale); |
736 XrmCombineFileDatabase (path, &db, False); | 736 |
737 } | 737 if (!access (path, R_OK)) |
738 XrmCombineFileDatabase (path, &db, False); | |
739 } | |
738 | 740 |
739 no_data_directory: | 741 no_data_directory: |
740 { | 742 xfree (locale); |
741 /* Cast off const for G++ 4.3. */ | |
742 Extbyte *temp = (Extbyte *) locale; | |
743 xfree (temp); | |
744 } | |
745 } | 743 } |
746 #endif /* MULE */ | 744 #endif /* MULE */ |
747 | 745 |
748 if (NILP (DEVICE_NAME (d))) | 746 if (NILP (DEVICE_NAME (d))) |
749 DEVICE_NAME (d) = display; | 747 DEVICE_NAME (d) = display; |