rpms/lirc/devel lirc-0.8.6-remove-obsolete-modes.patch,1.1,1.2
Jarod Wilson
jwilson at fedoraproject.org
Mon Feb 15 17:09:34 UTC 2010
- Previous message: rpms/gmime22/devel .cvsignore, 1.2, 1.3 gmime22.spec, 1.4, 1.5 sources, 1.2, 1.3
- Next message: rpms/poppler/F-12 poppler-0.12.3-rotated-downscale.patch, NONE, 1.1 poppler.spec, 1.111, 1.112
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: jwilson
Update of /cvs/pkgs/rpms/lirc/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14829
Modified Files:
lirc-0.8.6-remove-obsolete-modes.patch
Log Message:
Helps to patch the files using the patched header too
lirc-0.8.6-remove-obsolete-modes.patch:
daemons/hw_alsa_usb.c | 4 +-
daemons/hw_awlibusb.c | 62 ------------------------------------------
daemons/hw_bte.c | 4 --
daemons/hw_creative_infracd.c | 2 -
daemons/hw_default.c | 52 ++---------------------------------
daemons/hw_mplay.c | 4 +-
daemons/irrecord.c | 16 ----------
daemons/receive.c | 27 ++----------------
drivers/lirc.h | 7 ----
tools/mode2.c | 6 ----
10 files changed, 17 insertions(+), 167 deletions(-)
Index: lirc-0.8.6-remove-obsolete-modes.patch
===================================================================
RCS file: /cvs/pkgs/rpms/lirc/devel/lirc-0.8.6-remove-obsolete-modes.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- lirc-0.8.6-remove-obsolete-modes.patch 15 Feb 2010 16:17:06 -0000 1.1
+++ lirc-0.8.6-remove-obsolete-modes.patch 15 Feb 2010 17:09:34 -0000 1.2
@@ -2,7 +2,15 @@ Index: lirc-0.8.6/drivers/lirc.h
===================================================================
--- lirc-0.8.6.orig/drivers/lirc.h
+++ lirc-0.8.6/drivers/lirc.h
-@@ -27,17 +27,13 @@ typedef int lirc_t;
+@@ -11,6 +11,7 @@
+ #define __USE_LINUX_IOCTL_DEFS
+ #include <sys/ioctl.h>
+ #endif
++#include <stdint.h>
+
+ #define PULSE_BIT 0x01000000
+ #define PULSE_MASK 0x00FFFFFF
+@@ -27,17 +28,13 @@ typedef int lirc_t;
#define LIRC_MODE_RAW 0x00000001
#define LIRC_MODE_PULSE 0x00000002
#define LIRC_MODE_MODE2 0x00000004
@@ -20,7 +28,7 @@ Index: lirc-0.8.6/drivers/lirc.h
#define LIRC_CAN_SEND_MASK 0x0000003f
-@@ -48,9 +44,7 @@ typedef int lirc_t;
+@@ -48,9 +45,7 @@ typedef int lirc_t;
#define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW)
#define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE)
#define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2)
@@ -30,3 +38,396 @@ Index: lirc-0.8.6/drivers/lirc.h
#define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK)
+Index: lirc-0.8.6/daemons/hw_alsa_usb.c
+===================================================================
+--- lirc-0.8.6.orig/daemons/hw_alsa_usb.c
++++ lirc-0.8.6/daemons/hw_alsa_usb.c
+@@ -37,9 +37,9 @@ static int repeat_flag;
+ struct hardware hw_alsa_usb = {
+ "", /* default device */
+ -1, /* fd */
+- LIRC_CAN_REC_CODE, /* features */
++ LIRC_CAN_REC_LIRCCODE, /* features */
+ 0, /* send_mode */
+- LIRC_MODE_CODE, /* rec_mode */
++ LIRC_MODE_LIRCCODE, /* rec_mode */
+ 8, /* code_length */
+ init, /* init_func */
+ NULL, /* config_func */
+Index: lirc-0.8.6/daemons/hw_awlibusb.c
+===================================================================
+--- lirc-0.8.6.orig/daemons/hw_awlibusb.c
++++ lirc-0.8.6/daemons/hw_awlibusb.c
+@@ -48,8 +48,6 @@
+ #include "lircd.h"
+ #include "receive.h"
+
+-#define AW_MODE_LIRCCODE 1
+-
+ #define AWUSB_RECEIVE_BYTES 5
+ #define USB_TIMEOUT (1000*60)
+ #define AW_VENDOR_THOMSON 0x069b
+@@ -57,14 +55,6 @@
+
+ #define AW_KEY_GAP 0 /* Original value=200000. Made it 0 to handle it in userspace */
+
+-#if !defined(AW_MODE_LIRCCODE)
+-static ir_code code;
+-static ir_code code_last;
+-static struct timeval time_current = {0};
+-static struct timeval time_last = {0};
+-#endif
+-
+-
+ static int awlibusb_init();
+ static int awlibusb_deinit();
+ static char *awlibusb_rec(struct ir_remote *remotes);
+@@ -72,7 +62,6 @@ static void usb_read_loop(int fd);
+ static struct usb_device *find_usb_device(void);
+ static int find_device_endpoints(struct usb_device *dev);
+
+-#ifdef AW_MODE_LIRCCODE
+ struct hardware hw_awlibusb =
+ {
+ NULL, /* default device */
+@@ -91,26 +80,7 @@ struct hardware hw_awlibusb =
+ NULL, /* readdata */
+ "awlibusb"
+ };
+-#else
+-struct hardware hw_awlibusb =
+-{
+- NULL, /* default device */
+- -1, /* fd */
+- LIRC_CAN_REC_CODE, /* features */
+- 0, /* send_mode */
+- LIRC_MODE_CODE, /* rec_mode */
+- CHAR_BIT, /* code_length */
+- awlibusb_init, /* init_func */
+- NULL, /* config_func */
+- awlibusb_deinit, /* deinit_func */
+- NULL, /* send_func */
+- awlibusb_rec, /* rec_func */
+- receive_decode, /* decode_func */
+- NULL, /* ioctl_func */
+- NULL, /* readdata */
+- "awlibusb"
+-};
+-#endif
++
+ typedef struct {
+ u_int16_t vendor;
+ u_int16_t product;
+@@ -310,11 +280,6 @@ static void usb_read_loop(int fd)
+ {
+ int inited = 0;
+ int err = 0;
+-#if !defined(AW_MODE_LIRCCODE)
+- long elapsed_seconds = 0; /* diff between seconds counter */
+- long elapsed_useconds = 0; /* diff between microseconds counter */
+- long time_diff = 0;
+-#endif
+
+ alarm(0);
+ signal(SIGTERM, SIG_DFL);
+@@ -348,7 +313,6 @@ static void usb_read_loop(int fd)
+ if (bytes_r == 1) continue;
+ }
+
+-#ifdef AW_MODE_LIRCCODE
+ bytes_w = write(fd, &(buf[1]), (AWUSB_RECEIVE_BYTES-1));
+ /* ignore first byte */
+ if (bytes_w < 0)
+@@ -358,30 +322,6 @@ static void usb_read_loop(int fd)
+ err = 1;
+ goto done;
+ }
+-#else
+- code = buf[AWUSB_RECEIVE_BYTES-2];
+-
+- /* calculate time diff */
+- gettimeofday(&time_current, NULL);
+- elapsed_seconds = time_current.tv_sec - time_last.tv_sec;
+- elapsed_useconds = time_current.tv_usec - time_last.tv_usec;
+- time_diff = (elapsed_seconds) * 1000000 + elapsed_useconds;
+- //printf("time_diff = %d usec\n", time_diff);
+-
+- if ( !((code == code_last) && (time_diff < AW_KEY_GAP)) )
+- {
+- bytes_w = write(fd, &code, 1);
+- if (bytes_w < 0)
+- {
+- logprintf(LOG_ERR, "can't write to pipe: %s",
+- strerror(errno));
+- err = 1;
+- goto done;
+- }
+- code_last = code;
+- memcpy(&time_last, &time_current, sizeof(struct timeval));
+- }
+-#endif
+
+ }
+
+Index: lirc-0.8.6/daemons/hw_default.c
+===================================================================
+--- lirc-0.8.6.orig/daemons/hw_default.c
++++ lirc-0.8.6/daemons/hw_default.c
+@@ -42,10 +42,7 @@ extern struct ir_remote *repeat_remote;
+
+ static unsigned long supported_send_modes[]=
+ {
+- /* LIRC_CAN_SEND_STRING, I don't think there ever will be a driver
+- that supports that */
+ /* LIRC_CAN_SEND_LIRCCODE, */
+- /* LIRC_CAN_SEND_CODE, */
+ /* LIRC_CAN_SEND_MODE2, this one would be very easy */
+ LIRC_CAN_SEND_PULSE,
+ /* LIRC_CAN_SEND_RAW, */
+@@ -53,9 +50,7 @@ static unsigned long supported_send_mode
+ };
+ static unsigned long supported_rec_modes[]=
+ {
+- LIRC_CAN_REC_STRING,
+ LIRC_CAN_REC_LIRCCODE,
+- LIRC_CAN_REC_CODE,
+ LIRC_CAN_REC_MODE2,
+ /* LIRC_CAN_REC_PULSE, shouldn't be too hard */
+ /* LIRC_CAN_REC_RAW, */
+@@ -365,10 +360,6 @@ int default_init()
+ }
+
+ }
+- else if(hw.rec_mode==LIRC_MODE_CODE)
+- {
+- hw.code_length=8;
+- }
+ else if(hw.rec_mode==LIRC_MODE_LIRCCODE)
+ {
+ if(default_ioctl(LIRC_GET_LENGTH, &hw.code_length)==-1)
+@@ -524,47 +515,12 @@ int default_send(struct ir_remote *remot
+
+ char *default_rec(struct ir_remote *remotes)
+ {
+- char c;
+- int n;
+- static char message[PACKET_SIZE+1];
+-
+-
+- if(hw.rec_mode==LIRC_MODE_STRING)
+- {
+- int failed=0;
+-
+- /* inefficient but simple, fix this if you want */
+- n=0;
+- do
+- {
+- if(read(hw.fd,&c,1)!=1)
+- {
+- logprintf(LOG_ERR,"reading in mode "
+- "LIRC_MODE_STRING failed");
+- default_deinit();
+- return NULL;
+- }
+- if(n>=PACKET_SIZE-1)
+- {
+- failed=1;
+- n=0;
+- }
+- message[n++]=c;
+- }
+- while(c!='\n');
+- message[n]=0;
+- if(failed) return(NULL);
+- return(message);
+- }
+- else
++ if(!clear_rec_buffer())
+ {
+- if(!clear_rec_buffer())
+- {
+- default_deinit();
+- return NULL;
+- }
+- return(decode_all(remotes));
++ default_deinit();
++ return NULL;
+ }
++ return(decode_all(remotes));
+ }
+
+ static int default_config_frequency()
+Index: lirc-0.8.6/daemons/hw_mplay.c
+===================================================================
+--- lirc-0.8.6.orig/daemons/hw_mplay.c
++++ lirc-0.8.6/daemons/hw_mplay.c
+@@ -114,9 +114,9 @@ static struct {
+ struct hardware hw_mplay = {
+ LIRC_DRIVER_DEVICE, /* default device */
+ -1, /* fd */
+- LIRC_CAN_REC_CODE, /* features */
++ LIRC_CAN_REC_LIRCCODE, /* features */
+ 0, /* send_mode */
+- LIRC_MODE_CODE, /* rec_mode */
++ LIRC_MODE_LIRCCODE, /* rec_mode */
+ MPLAY_CODE_LENGTH, /* code_length */
+ mplay_init, /* init_func */
+ NULL, /* config_func */
+Index: lirc-0.8.6/daemons/irrecord.c
+===================================================================
+--- lirc-0.8.6.orig/daemons/irrecord.c
++++ lirc-0.8.6/daemons/irrecord.c
+@@ -556,16 +556,7 @@ int main(int argc,char **argv)
+ }
+ aeps = (hw.resolution>aeps ? hw.resolution:aeps);
+
+- if(hw.rec_mode==LIRC_MODE_STRING)
+- {
+- fprintf(stderr,"%s: no config file necessary\n",progname);
+- fclose(fout);
+- unlink(filename);
+- if(hw.deinit_func) hw.deinit_func();
+- exit(EXIT_SUCCESS);
+- }
+ if(hw.rec_mode!=LIRC_MODE_MODE2 &&
+- hw.rec_mode!=LIRC_MODE_CODE &&
+ hw.rec_mode!=LIRC_MODE_LIRCCODE)
+ {
+ fprintf(stderr,"%s: mode not supported\n",progname);
+@@ -661,10 +652,8 @@ int main(int argc,char **argv)
+ (unsigned long) remote.gap);
+ # endif
+ break;
+- case LIRC_MODE_CODE:
+ case LIRC_MODE_LIRCCODE:
+- if(hw.rec_mode==LIRC_MODE_CODE) remote.bits=CHAR_BIT;
+- else remote.bits=hw.code_length;
++ remote.bits=hw.code_length;
+ if(!using_template && !get_gap_length(&remote))
+ {
+ fprintf(stderr,"%s: gap not found,"
+@@ -995,9 +984,6 @@ void flushhw(void)
+ case LIRC_MODE_MODE2:
+ while(availabledata()) hw.readdata(0);
+ return;
+- case LIRC_MODE_CODE:
+- size=sizeof(unsigned char);
+- break;
+ case LIRC_MODE_LIRCCODE:
+ size=hw.code_length/CHAR_BIT;
+ if(hw.code_length%CHAR_BIT) size++;
+Index: lirc-0.8.6/daemons/receive.c
+===================================================================
+--- lirc-0.8.6.orig/daemons/receive.c
++++ lirc-0.8.6/daemons/receive.c
+@@ -126,18 +126,6 @@ int clear_rec_buffer(void)
+ ((ir_code) buffer[i]);
+ }
+ }
+- else if(hw.rec_mode==LIRC_MODE_CODE)
+- {
+- unsigned char c;
+-
+- if(read(hw.fd,&c,1)!=1)
+- {
+- logprintf(LOG_ERR,"reading in mode LIRC_MODE_CODE "
+- "failed");
+- return(0);
+- }
+- rec_buffer.decoded=(ir_code) c;
+- }
+ else
+ {
+ lirc_t data;
+@@ -1191,8 +1179,7 @@ int receive_decode(struct ir_remote *rem
+ struct ir_ncode *codes,*found;
+ int i;
+
+- if(hw.rec_mode==LIRC_MODE_CODE ||
+- hw.rec_mode==LIRC_MODE_LIRCCODE)
++ if(hw.rec_mode==LIRC_MODE_LIRCCODE)
+ return(0);
+
+ codes=remote->codes;
+@@ -1233,8 +1220,7 @@ int receive_decode(struct ir_remote *rem
+ }
+ else
+ {
+- if(hw.rec_mode==LIRC_MODE_CODE ||
+- hw.rec_mode==LIRC_MODE_LIRCCODE)
++ if(hw.rec_mode==LIRC_MODE_LIRCCODE)
+ {
+ lirc_t sum;
+ ir_code decoded = rec_buffer.decoded;
+@@ -1244,11 +1230,7 @@ int receive_decode(struct ir_remote *rem
+ # else
+ LOGPRINTF(1,"decoded: %lx", decoded);
+ # endif
+- if((hw.rec_mode==LIRC_MODE_CODE &&
+- hw.code_length<bit_count(remote))
+- ||
+- (hw.rec_mode==LIRC_MODE_LIRCCODE &&
+- hw.code_length!=bit_count(remote)))
++ if(hw.code_length!=bit_count(remote))
+ {
+ return(0);
+ }
+@@ -1366,8 +1348,7 @@ int receive_decode(struct ir_remote *rem
+ *repeat_flagp=1;
+ else
+ *repeat_flagp=0;
+- if(hw.rec_mode==LIRC_MODE_CODE ||
+- hw.rec_mode==LIRC_MODE_LIRCCODE)
++ if(hw.rec_mode==LIRC_MODE_LIRCCODE)
+ {
+ /* Most TV cards don't pass each signal to the
+ driver. This heuristic should fix repeat in such
+Index: lirc-0.8.6/tools/mode2.c
+===================================================================
+--- lirc-0.8.6.orig/tools/mode2.c
++++ lirc-0.8.6/tools/mode2.c
+@@ -273,11 +273,7 @@ int main(int argc,char **argv)
+
+ }
+
+- if(mode==LIRC_MODE_CODE)
+- {
+- count = 1;
+- }
+- else if(mode==LIRC_MODE_LIRCCODE)
++ if(mode==LIRC_MODE_LIRCCODE)
+ {
+ if(use_raw_access)
+ {
+Index: lirc-0.8.6/daemons/hw_bte.c
+===================================================================
+--- lirc-0.8.6.orig/daemons/hw_bte.c
++++ lirc-0.8.6/daemons/hw_bte.c
+@@ -66,14 +66,10 @@ struct hardware hw_bte=
+ LIRC_DRIVER_DEVICE, /* default device */
+ -1, /* fd */
+ #if BTE_CAN_SEND
+- LIRC_CAN_REC_STRING|LIRC_CAN_SEND_STRING, /* features */
+- LIRC_MODE_STRING, /* send_mode */
+ #else
+- LIRC_CAN_REC_STRING, /* features */
+ 0, /* send_mode */
+ #endif
+
+- LIRC_MODE_STRING, /* rec_mode */
+ 16, /* code_length */
+ bte_init, /* init_func */
+ NULL, /* config_func */
+Index: lirc-0.8.6/daemons/hw_creative_infracd.c
+===================================================================
+--- lirc-0.8.6.orig/daemons/hw_creative_infracd.c
++++ lirc-0.8.6/daemons/hw_creative_infracd.c
+@@ -46,7 +46,7 @@
+ struct hardware hw_creative_infracd = {
+ 0, /* determine device by probing */
+ -1, /* fd */
+- LIRC_CAN_REC_CODE, /* features */
++ LIRC_CAN_REC_LIRCCODE, /* features */
+ 0, /* send_mode */
+ LIRC_MODE_LIRCCODE, /* rec_mode */
+ 8, /* code_length */
- Previous message: rpms/gmime22/devel .cvsignore, 1.2, 1.3 gmime22.spec, 1.4, 1.5 sources, 1.2, 1.3
- Next message: rpms/poppler/F-12 poppler-0.12.3-rotated-downscale.patch, NONE, 1.1 poppler.spec, 1.111, 1.112
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list