[PD-cvs] externals/hcs/hid make-arrays-from-input.h.pl,1.8,1.9

Hans-Christoph Steiner eighthave at users.sourceforge.net
Tue Jan 24 18:44:42 CET 2006


Update of /cvsroot/pure-data/externals/hcs/hid
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21680

Modified Files:
	make-arrays-from-input.h.pl 
Log Message:
SYN_MAX is not set in linux/input.h and there are only two event codes listed.  But the kernel actually puts out a lot of different SYN events.  So this script now generates a ev_syn array with 512 init'ed items in the array.  That should stop the sigfaults, but it might be a hack

Index: make-arrays-from-input.h.pl
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/hid/make-arrays-from-input.h.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** make-arrays-from-input.h.pl	11 Jun 2005 03:04:40 -0000	1.8
--- make-arrays-from-input.h.pl	24 Jan 2006 17:44:40 -0000	1.9
***************
*** 1,3 ****
! #!/usr/bin/perl 
  
  use Switch;
--- 1,3 ----
! #!/usr/bin/perl -w
  
  use Switch;
***************
*** 38,42 ****
  	 { 
  		  if ($2) { $index = hex($3); } else { $index = $3; }
! 		  if ($index >=0) 
  		  {
  				$returnArray[0] = $index;
--- 38,42 ----
  	 { 
  		  if ($2) { $index = hex($3); } else { $index = $3; }
! 		  if ($index >= 0) 
  		  {
  				$returnArray[0] = $index;
***************
*** 50,53 ****
--- 50,73 ----
  
  #------------------------------------------------------------------------
+ # 
+ #  this is under construction to make the MAX switch structure cleaner
+ # donno if it works yet.
+ sub createNewArray
+ {
+ 	 my $myTypeName = shift;
+ 	 my $myTypeMaxName = shift;
+ 
+ 	 my $myIndex;
+ 	 my $myValue;
+ 	 my @myNewArray;
+ 
+ 	 ($myIndex, $myValue) = getDataFromHeaderLine($myTypeMaxName);
+ 	 @myNewArray = initArrayWithGenericNames( $myTypeName, $myIndex + 1 );
+ 	 
+ 	 return @myNewArray;
+ }
+ 
+ 
+ #------------------------------------------------------------------------
  # declare each array in the header
  #
***************
*** 157,163 ****
  				case "KEY"       { ($index, $value) = getDataFromHeaderLine($_);
  										 @KEY = initArrayWithGenericNames( "KEY", $index + 1 ); }
!             # BTN codes are actually part of the KEY type
! 				case "BTN"       { ($index, $value) = getDataFromHeaderLine($_);
! 										 @BTN = initArrayWithGenericNames( "KEY", $index + 1 ); }
  				case "REL"       { ($index, $value) = getDataFromHeaderLine($_);
  										 @REL = initArrayWithGenericNames( "REL", $index + 1 ); }
--- 177,183 ----
  				case "KEY"       { ($index, $value) = getDataFromHeaderLine($_);
  										 @KEY = initArrayWithGenericNames( "KEY", $index + 1 ); }
! # BTN codes are actually part of the KEY type, so this array is unused
! #				case "BTN"       { ($index, $value) = getDataFromHeaderLine($_);
! #										 @BTN = initArrayWithGenericNames( "KEY", $index + 1 ); }
  				case "REL"       { ($index, $value) = getDataFromHeaderLine($_);
  										 @REL = initArrayWithGenericNames( "REL", $index + 1 ); }
***************
*** 183,186 ****
--- 203,210 ----
  }
  
+ # there is no SYN_MAX defined in input.h, so we set it here:
+ @SYN = initArrayWithGenericNames( "SYN", 512 );
+ 
+ 
  seek( INPUT_H, 0, 0 );
  while (<INPUT_H>)





More information about the Pd-cvs mailing list