Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / multimedia / fxtv / patches / patch-actions_c
blob346efbe714b3e1785d08d4aa973135cda066f55c
1 $NetBSD$
3 Fix LP64 problems.
4 Fix illegal C.
6 --- actions.c~  2001-02-12 19:26:23.000000000 +0000
7 +++ actions.c
8 @@ -238,7 +238,7 @@ static void TVACTIONKeyStationEntryHdlr(
9          S_chan_entry_active = TRUE;
10          S_entry_freq   = do_freq;
11          if ( isa_digit )
12 -            sprintf( S_chan_str, "%ld", digit );
13 +            sprintf( S_chan_str, "%d", digit );
14          else if ( do_freq )
15              strcpy( S_chan_str, "f" );
16          else 
17 @@ -549,7 +549,7 @@ static void TVActionSetStationAction(
19          /*  Are we incrementally changing the channel or frequency?  */
20          if (( str[0] == '+' ) || ( str[0] == '-' )) {
21 -            if ( toupper( str[1] ) == 'F' )
22 +            if ( toupper( (unsigned char)str[1] ) == 'F' )
23                  freq_inc = ( str[0] == '-' ? -1 : +1 );
24              else {
25                  chan_inc = atoi( str );
26 @@ -609,7 +609,7 @@ static void TVActionSetStationAction(
27              if (( sscanf( str, "f%f", &chan_freq ) == 1 ) ||
28                  ( sscanf( str, "F%f", &chan_freq ) == 1 )) 
29                  chan_num  = -1;
30 -            else if (( sscanf( str, "%ld", &chan_num ) == 1 ) &&
31 +            else if (( sscanf( str, "%d", &chan_num ) == 1 ) &&
32                       ( chan_num >= TV_CHAN_MIN ))
33                  chan_freq = 0.0;
34              else {
35 @@ -729,8 +729,10 @@ static void TVActionToggleZoomAction(
37          arg[0] = '\0';
38          strncat( arg, params[0], sizeof(arg)-1 );
39 -        while ( *p != '\0' )
40 -            *(p++) = tolower( *p );
41 +        while ( *p != '\0' ) {
42 +            *p = tolower( (unsigned char)*p );
43 +           p++;
44 +       }
45          if ( strncmp( arg, "win", strlen("win") ) == 0 )
46              fullscreen = False;
47          else if ( strncmp( arg, "full", strlen("full") ) == 0 )
48 @@ -925,8 +927,10 @@ static void TVActionSetCaptureInputActio
50              arg[0] = '\0';
51              strncat( arg, str, sizeof(arg)-1 );
52 -            while ( *p != '\0' )
53 -                *(p++) = tolower( *p );
54 +            while ( *p != '\0' ) {
55 +                *p = tolower( (unsigned char)*p );
56 +               p++;
57 +           }
59              if ( strncmp( str, "tuner", strlen("tuner") ) == 0 )
60                  dev = TV_DEVICE_TUNER;
61 @@ -1032,8 +1036,10 @@ static void TVActionSetTunerModeAction(
63              arg[0] = '\0';
64              strncat( arg, str, sizeof(arg)-1 );
65 -            while ( *p != '\0' )
66 -                *(p++) = tolower( *p );
67 +            while ( *p != '\0' ) {
68 +                *p = tolower( (unsigned char)*p );
69 +               p++;
70 +           }
72              if ( strncmp( str, "ant", strlen("ant") ) == 0 )
73                  mode = TV_TUNER_MODE_ANTENNA;
74 @@ -1151,7 +1157,7 @@ static void TVActionSaveImageAction(
75          else
76              len = p - dsk->fn_freeze_base;
78 -        sprintf( fname, "%.*s%.3ld%s", (int)len, dsk->fn_freeze_base, 
79 +        sprintf( fname, "%.*s%.3d%s", (int)len, dsk->fn_freeze_base, 
80                          dsk->freeze_next_suffix, (p ? p : "") );
81      }
82      else
83 @@ -1306,7 +1312,7 @@ static void TVActionVideoRecordStartActi
84      }
86      if (( *num_params == 1 ) && params[0] ) {
87 -        if (( sscanf( params[0], "%ldx%ld", &w, &h ) != 2 ) ||
88 +        if (( sscanf( params[0], "%dx%d", &w, &h ) != 2 ) ||
89              ( w <= 0 ) || ( h <= 0 )) {
90              fprintf( stderr, 
91                  "TVActionVideoRecordStartAction:  Bad resolution.\n" );
92 @@ -1426,7 +1432,7 @@ void TVActionSetVolume( TV_INT32 vol )
93      String   param[1] = { str };
94      Cardinal num_param = 1;
96 -    sprintf( str, "%ld", vol );
97 +    sprintf( str, "%d", vol );
98      TVActionSetVolumeAction( NULL, NULL, param, &num_param );
99  }
101 @@ -1436,7 +1442,7 @@ void TVActionSetVolumeRel( TV_INT32 vol_
102      String   param[1] = { str };
103      Cardinal num_param = 1;
105 -    sprintf( str, "%+ld", vol_delta );
106 +    sprintf( str, "%+d", vol_delta );
107      TVActionSetVolumeAction( NULL, NULL, param, &num_param );
110 @@ -1467,7 +1473,7 @@ void TVActionSetCaptureInputRel( TV_INT3
111      String   param[1] = { str };
112      Cardinal num_param = 1;
114 -    sprintf( str, "%+ld", dev_delta );
115 +    sprintf( str, "%+d", dev_delta );
116      TVActionSetCaptureInputAction( NULL, NULL, param, &num_param );
119 @@ -1528,7 +1534,7 @@ static void TVActionFlipStationAction(
120      }
122      if ( p->last_chan >= TV_CHAN_MIN )
123 -      sprintf( chan_str, "%ld" , p->last_chan );
124 +      sprintf( chan_str, "%d" , p->last_chan );
125      else
126        sprintf( chan_str, "f%f", p->last_freq );
127      TVActionSetStation( chan_str );