Revision: 6667
Author: ek.kato
Date: Wed Aug  4 01:38:17 2010
Log: * replace/daemon.c
  - Define _PATH_DEVNULL if not defined.
* helper/eggtrayicon.c
  - Fix compilation with older GTK+.
* uim/lolevel.c
  - s/u_int16_t/uint16_t/, s/u_int32_t/uint32_t/,
    s/u_int8_t/uint8_t/.
* uim/socket.c
  - Use PF_UNIX if PF_LOCAL is not defined.
  - Don't use variable named 'sun'.

http://code.google.com/p/uim/source/detail?r=6667

Modified:
 /trunk/helper/eggtrayicon.c
 /trunk/replace/daemon.c
 /trunk/uim/lolevel.c
 /trunk/uim/socket.c

=======================================
--- /trunk/helper/eggtrayicon.c Wed Jul 14 18:04:32 2010
+++ /trunk/helper/eggtrayicon.c Wed Aug  4 01:38:17 2010
@@ -567,8 +567,10 @@
     colormap = gdk_screen_get_system_colormap (screen);
   else if (visual == gdk_screen_get_rgb_visual (screen))
     colormap = gdk_screen_get_rgb_colormap (screen);
+#if GTK_CHECK_VERSION(2, 8, 0)
   else if (visual == gdk_screen_get_rgba_visual (screen))
     colormap = gdk_screen_get_rgba_colormap (screen);
+#endif
   else
     {
       colormap = gdk_colormap_new (visual, FALSE);
=======================================
--- /trunk/replace/daemon.c     Mon Feb  2 22:15:16 2009
+++ /trunk/replace/daemon.c     Wed Aug  4 01:38:17 2010
@@ -48,6 +48,10 @@
 # include <unistd.h>
 #endif

+#ifndef _PATH_DEVNULL
+#define _PATH_DEVNULL "/dev/null"
+#endif
+
 /* XXX */
 #undef HAVE_CYGWIN

=======================================
--- /trunk/uim/lolevel.c        Sun Apr 11 20:22:19 2010
+++ /trunk/uim/lolevel.c        Wed Aug  4 01:38:17 2010
@@ -325,7 +325,7 @@
 static uim_lisp
 c_u16_to_u8list(uim_lisp u16_)
 {
-  u_int16_t u16 = htons(C_INT(u16_));
+  uint16_t u16 = htons(C_INT(u16_));

   return LIST2(MAKE_INT(u16 & 0xff),
               MAKE_INT((u16 >> 8) & 0xff));
@@ -333,7 +333,7 @@
 static uim_lisp
 c_u32_to_u8list(uim_lisp u32_)
 {
-  u_int32_t u32 = htonl(C_INT(u32_));
+  uint32_t u32 = htonl(C_INT(u32_));

   return LIST4(MAKE_INT(u32 & 0xff),
               MAKE_INT((u32 >> 8) & 0xff),
@@ -359,7 +359,7 @@
 static uim_lisp
 c_u8list_to_u16(uim_lisp u8list_)
 {
-  u_int8_t u8_1, u8_2;
+  uint8_t u8_1, u8_2;

   u8_1 = C_INT(CAR(u8list_));
   u8_2 = C_INT(CAR(CDR(u8list_)));
@@ -369,7 +369,7 @@
 static uim_lisp
 c_u8list_to_u32(uim_lisp u8list_)
 {
-  u_int8_t u8_1, u8_2, u8_3, u8_4;
+  uint8_t u8_1, u8_2, u8_3, u8_4;

   u8_1 = C_INT(CAR(u8list_));
   u8_2 = C_INT(CAR(CDR(u8list_)));
@@ -398,7 +398,7 @@
 static uim_lisp
 c_u32_to_s32(uim_lisp u32_)
 {
-  u_int32_t u32 = C_INT(u32_);
+  uint32_t u32 = C_INT(u32_);

   return MAKE_INT((int32_t)u32);
 }
=======================================
--- /trunk/uim/socket.c Tue Apr 20 01:46:51 2010
+++ /trunk/uim/socket.c Wed Aug  4 01:38:17 2010
@@ -127,7 +127,11 @@

 const static opt_args ai_family[] = {
   { PF_UNSPEC, "$PF_UNSPEC" },
+#ifndef PF_LOCAL
+  { PF_UNIX,   "$PF_LOCAL" },
+#else
   { PF_LOCAL,  "$PF_LOCAL" },
+#endif
   { PF_INET,   "$PF_INET" },
   { PF_INET6,  "$PF_INET6" },
   { 0, 0 }
@@ -339,52 +343,52 @@
 static uim_lisp
 c_make_sockaddr_un(void)
 {
-  struct sockaddr_un *sun;
-
-  sun = uim_malloc(sizeof(struct sockaddr_un));
-  memset(sun, 0, sizeof(struct sockaddr_un));
-  return MAKE_PTR(sun);
+  struct sockaddr_un *s_un;
+
+  s_un = uim_malloc(sizeof(struct sockaddr_un));
+  memset(s_un, 0, sizeof(struct sockaddr_un));
+  return MAKE_PTR(s_un);
 }

 static uim_lisp
 c_delete_sockaddr_un(uim_lisp sun_)
 {
-  struct sockaddr_un *sun = C_PTR(sun_);
-
-  free(sun);
+  struct sockaddr_un *s_un = C_PTR(sun_);
+
+  free(s_un);
   return uim_scm_t();
 }

 static uim_lisp
 c_set_sockaddr_un_sun_family(uim_lisp sun_, uim_lisp family_)
 {
-  struct sockaddr_un *sun = C_PTR(sun_);
-
-  sun->sun_family = C_INT(family_);
+  struct sockaddr_un *s_un = C_PTR(sun_);
+
+  s_un->sun_family = C_INT(family_);
   return uim_scm_t();
 }
 static uim_lisp
 c_ref_sockaddr_un_sun_family(uim_lisp sun_)
 {
-  struct sockaddr_un *sun = C_PTR(sun_);
-
-  return MAKE_INT(sun->sun_family);
+  struct sockaddr_un *s_un = C_PTR(sun_);
+
+  return MAKE_INT(s_un->sun_family);
 }

 static uim_lisp
 c_set_sockaddr_un_sun_path(uim_lisp sun_, uim_lisp path_)
 {
-  struct sockaddr_un *sun = C_PTR(sun_);
-
-  strlcpy(sun->sun_path, REFER_C_STR(path_), sizeof(sun->sun_path));
+  struct sockaddr_un *s_un = C_PTR(sun_);
+
+  strlcpy(s_un->sun_path, REFER_C_STR(path_), sizeof(s_un->sun_path));
   return uim_scm_t();
 }
 static uim_lisp
 c_ref_sockaddr_un_sun_path(uim_lisp sun_)
 {
-  struct sockaddr_un *sun = C_PTR(sun_);
-
-  return MAKE_STR(sun->sun_path);
+  struct sockaddr_un *s_un = C_PTR(sun_);
+
+  return MAKE_STR(s_un->sun_path);
 }

 #ifndef SUN_LEN
@@ -395,9 +399,9 @@
 static uim_lisp
 c_sun_len(uim_lisp sun_)
 {
-  struct sockaddr_un *sun = C_PTR(sun_);
-
-  return MAKE_INT(SUN_LEN(sun));
+  struct sockaddr_un *s_un = C_PTR(sun_);
+
+  return MAKE_INT(SUN_LEN(s_un));
 }

 static uim_lisp

Reply via email to