svn commit: r320971 - in head/misc/hotkeys: . files

William Grzybowski wg at FreeBSD.org
Fri Jun 14 22:25:14 UTC 2013


Author: wg
Date: Fri Jun 14 22:25:13 2013
New Revision: 320971
URL: http://svnweb.freebsd.org/changeset/ports/320971

Log:
  misc/hotkeys: fix build with clang
  
  - Fix build with clang, return type error
  - Add LICENSE (GPLv2)
  - Trim Makefile header
  
  Approved by:	culot / jpaetzel (mentors, implicit)

Modified:
  head/misc/hotkeys/Makefile
  head/misc/hotkeys/files/patch-src-hotkeys.c

Modified: head/misc/hotkeys/Makefile
==============================================================================
--- head/misc/hotkeys/Makefile	Fri Jun 14 22:22:51 2013	(r320970)
+++ head/misc/hotkeys/Makefile	Fri Jun 14 22:25:13 2013	(r320971)
@@ -1,7 +1,4 @@
-# New ports collection makefile for:	hotkeys
-# Date created:				May 20th, 2003
-# Whom:					Andy Pavlo <amp0928 at rit.edu>
-#
+# Created by: Andy Pavlo <amp0928 at rit.edu>
 # $FreeBSD$
 
 PORTNAME=	hotkeys
@@ -14,6 +11,8 @@ DISTNAME=	hotkeys_${PORTVERSION}
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	Allows usage of special keys on internet/multimedia keyboards
 
+LICENSE=	GPLv2
+
 LIB_DEPENDS=	xml2.5:${PORTSDIR}/textproc/libxml2
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}

Modified: head/misc/hotkeys/files/patch-src-hotkeys.c
==============================================================================
--- head/misc/hotkeys/files/patch-src-hotkeys.c	Fri Jun 14 22:22:51 2013	(r320970)
+++ head/misc/hotkeys/files/patch-src-hotkeys.c	Fri Jun 14 22:25:13 2013	(r320971)
@@ -1,6 +1,8 @@
---- src/hotkeys.c.orig	Wed Dec  4 03:26:32 2002
-+++ src/hotkeys.c	Mon Mar  5 20:33:39 2007
-@@ -54,7 +54,7 @@
+diff --git src/hotkeys.c src/hotkeys.c
+index b3ac52a..9a7cc82 100644
+--- src/hotkeys.c
++++ src/hotkeys.c
+@@ -54,7 +54,7 @@ extern char *getenv();
  #include <fcntl.h>
  #include <sys/ioctl.h>
  #if defined (__FreeBSD__)
@@ -9,7 +11,7 @@
  #else
  #       if defined (__NetBSD__) || defined (__OpenBSD__)
  #       include <soundcard.h>          /* OSS emulation */
-@@ -66,9 +66,9 @@
+@@ -66,9 +66,9 @@ extern char *getenv();
  #endif                          /* __FreeBSD__ */
  
  /* CDROM related */
@@ -21,7 +23,7 @@
  #if HAVE_GTK
    #include "splash.h"
  #endif
-@@ -585,7 +585,7 @@
+@@ -585,7 +585,7 @@ adjustVol(int adj)
  {
      int         mixer_fd = -1, cdrom_fd = -1;
      int         master_vol, cd_vol;
@@ -30,7 +32,16 @@
      int         left, right;
      static struct timeval last_time;
      struct timeval this_time;
-@@ -683,6 +683,7 @@
+@@ -595,7 +595,7 @@ adjustVol(int adj)
+     int sign = adj > 0 ? 1 : -1;
+ 
+     if ( adj == 0 )
+-        return;
++        return 0;
+ 
+     if ( multiplier == 0 )
+     {
+@@ -683,6 +683,7 @@ adjustVol(int adj)
      }
  
      /* open the cdrom/dvdrom drive device */
@@ -38,7 +49,7 @@
      if ( cdromDevice != NULL )
      {
          if ( (cdrom_fd = open( cdromDevice, O_RDONLY|O_NONBLOCK )) == -1 )
-@@ -691,7 +692,7 @@
+@@ -691,7 +692,7 @@ adjustVol(int adj)
          }
          else
          {
@@ -47,7 +58,7 @@
              if ( ioctl(cdrom_fd, CDROMVOLREAD, &cdrom_vol) == -1 )
              {
                  uError("Unable to read the CDROM volume of `%s'", cdromDevice);
-@@ -699,7 +700,7 @@
+@@ -699,7 +700,7 @@ adjustVol(int adj)
              }
              else
              {
@@ -56,7 +67,7 @@
                  int     t;
                  float   myAdj;
                  myAdj = 0xFF / 100.0 * adj;
-@@ -721,9 +722,10 @@
+@@ -721,9 +722,10 @@ adjustVol(int adj)
              }
          }
      }
@@ -68,7 +79,7 @@
  
      return ret;
  }
-@@ -737,10 +739,10 @@
+@@ -737,10 +739,10 @@ doMute(void)
  {
      static Bool             muted = False;
      static int              last_mixer_vol, last_cd_vol;
@@ -81,7 +92,7 @@
      int                     mixer_fd = -1, cdrom_fd = -1;
  
      short ret = 0;      /* return value */
-@@ -751,6 +753,7 @@
+@@ -751,6 +753,7 @@ doMute(void)
          uError("Unable to open `%s'", MIXER_DEV);
      }
      /* open the cdrom/dvdrom drive device */
@@ -89,7 +100,7 @@
      if ( cdromDevice != NULL )
      {
          if ( (cdrom_fd = open( cdromDevice, O_RDONLY|O_NONBLOCK )) == -1 )
-@@ -758,6 +761,7 @@
+@@ -758,6 +761,7 @@ doMute(void)
              uError("Unable to open `%s'", cdromDevice);
          }
      }
@@ -97,7 +108,7 @@
  
      if ( muted )
      {
-@@ -783,6 +787,7 @@
+@@ -783,6 +787,7 @@ doMute(void)
  #endif
              }
          }
@@ -105,7 +116,7 @@
  #if 0
          if (SOUND_IOCTL(mixer_fd, SOUND_MIXER_WRITE_CD, &last_cd_vol) == -1)
          {
-@@ -800,6 +805,7 @@
+@@ -800,6 +805,7 @@ doMute(void)
              } else
                  muted = False;
          }
@@ -113,7 +124,7 @@
      }
      else    /* ! muted */
      {
-@@ -837,6 +843,7 @@
+@@ -837,6 +843,7 @@ doMute(void)
                  }
              }
          }
@@ -121,7 +132,7 @@
  #if 0
          if ( SOUND_IOCTL(mixer_fd, SOUND_MIXER_READ_CD, &last_cd_vol) == -1)
          {
-@@ -853,7 +860,9 @@
+@@ -853,7 +860,9 @@ doMute(void)
                  muted = True;
          }
  #endif
@@ -131,7 +142,7 @@
          if (cdrom_fd != -1)
          {
              if ( ioctl(cdrom_fd, CDROMVOLREAD, &last_cdrom_vol) == -1 )
-@@ -863,8 +872,8 @@
+@@ -863,8 +872,8 @@ doMute(void)
              }
              else
              {
@@ -142,7 +153,7 @@
                  cdrom_vol.channel0 = cdrom_vol.channel1 = cdrom_vol.channel2 =
                      cdrom_vol.channel3 = 0;
                  if ( ioctl(cdrom_fd, CDROMVOLCTRL, &cdrom_vol) == -1 )
-@@ -875,10 +884,11 @@
+@@ -875,10 +884,11 @@ doMute(void)
                      muted = True;
              }
          }
@@ -155,7 +166,7 @@
  
      return ret;
  }
-@@ -886,19 +896,20 @@
+@@ -886,19 +896,20 @@ doMute(void)
  static int 
  ejectDisc(void)
  {
@@ -180,7 +191,7 @@
              case CDS_TRAY_OPEN:
  #ifdef HAVE_LIBXOSD
                  if ( osd )
-@@ -929,7 +940,7 @@
+@@ -929,7 +940,7 @@ ejectDisc(void)
              case CDS_NO_INFO:
              case CDS_DRIVE_NOT_READY:
              default:
@@ -189,7 +200,7 @@
                  break;
          }
          close(fd);
-@@ -940,6 +951,7 @@
+@@ -940,6 +951,7 @@ ejectDisc(void)
          SYSLOG(LOG_NOTICE, "CDROM_DRIVE_STATUS failed: %s\n", strerror(errno));
          return -1;
      }
@@ -197,7 +208,7 @@
  }
  
  
-@@ -1002,8 +1014,8 @@
+@@ -1002,8 +1014,8 @@ launchApp(int keycode)
  #ifdef HAVE_LIBXOSD
          if ( osd )
          {
@@ -208,7 +219,7 @@
          }
  #endif
      }
-@@ -1015,13 +1027,14 @@
+@@ -1015,13 +1027,14 @@ launchApp(int keycode)
  int
  sleepState(int mode)
  {
@@ -225,7 +236,7 @@
          error = system("apm -S");
          break;
        default:
-@@ -1039,10 +1052,10 @@
+@@ -1039,10 +1052,10 @@ sleepState(int mode)
      }
      switch (mode)
      {
@@ -238,7 +249,7 @@
          error = apm_standby(fd);
          break;
        default:
-@@ -1050,7 +1063,9 @@
+@@ -1050,7 +1063,9 @@ sleepState(int mode)
          break;
      }
      apm_close(fd);
@@ -249,7 +260,7 @@
  }
  
  
-@@ -1105,8 +1120,8 @@
+@@ -1105,8 +1120,8 @@ lookupUserCmd(const int keycode)
  #ifdef HAVE_LIBXOSD
                  if ( osd )
                  {
@@ -260,7 +271,7 @@
                  }
  #endif
                  break;  /* break the for loop */
-@@ -1435,15 +1450,16 @@
+@@ -1435,15 +1450,16 @@ initXOSD(void)
  #ifdef HAVE_LIBXOSD
      if ( osd )
      {
@@ -286,7 +297,7 @@
      }
  #endif
  }
-@@ -1592,6 +1608,7 @@
+@@ -1592,6 +1608,7 @@ main(int argc, char *argv[])
                  doMute();
              } else
              /* APM stuffs */
@@ -294,7 +305,7 @@
              if ( ev.message.keycode == (kbd.defCmds)[sleepKey].key ||
                   ev.message.keycode == (kbd.defCmds)[wakeupKey].key ) {
                  sleepState(STANDBY);
-@@ -1601,14 +1618,15 @@
+@@ -1601,14 +1618,15 @@ main(int argc, char *argv[])
              }
              else
              {


More information about the svn-ports-all mailing list