comparison src/sound.c @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 308d34e9f07d
children
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
122 CHECK_STRING (file); 122 CHECK_STRING (file);
123 if (NILP (volume)) 123 if (NILP (volume))
124 vol = bell_volume; 124 vol = bell_volume;
125 else 125 else
126 { 126 {
127 CHECK_INT (volume); 127 CHECK_FIXNUM (volume);
128 vol = XINT (volume); 128 vol = XFIXNUM (volume);
129 } 129 }
130 130
131 GCPRO1 (file); 131 GCPRO1 (file);
132 while (1) 132 while (1)
133 { 133 {
243 (SYMBOLP (XCAR (elt)) || 243 (SYMBOLP (XCAR (elt)) ||
244 STRINGP (XCAR (elt)))) 244 STRINGP (XCAR (elt))))
245 { 245 {
246 *sound = XCAR (elt); 246 *sound = XCAR (elt);
247 } 247 }
248 else if (INT_OR_FLOATP (XCAR (elt)) && /* ( name <vol> . <sound> ) */ 248 else if (FIXNUM_OR_FLOATP (XCAR (elt)) && /* ( name <vol> . <sound> ) */
249 (SYMBOLP (XCDR (elt)) || 249 (SYMBOLP (XCDR (elt)) ||
250 STRINGP (XCDR (elt)))) 250 STRINGP (XCDR (elt))))
251 { 251 {
252 *volume = XCAR (elt); 252 *volume = XCAR (elt);
253 *sound = XCDR (elt); 253 *sound = XCDR (elt);
254 } 254 }
255 else if (INT_OR_FLOATP (XCAR (elt)) && /* ( name <vol> <sound> ) */ 255 else if (FIXNUM_OR_FLOATP (XCAR (elt)) && /* ( name <vol> <sound> ) */
256 CONSP (XCDR (elt)) && 256 CONSP (XCDR (elt)) &&
257 NILP (XCDR (XCDR (elt))) && 257 NILP (XCDR (XCDR (elt))) &&
258 (SYMBOLP (XCAR (XCDR (elt))) || 258 (SYMBOLP (XCAR (XCDR (elt))) ||
259 STRINGP (XCAR (XCDR (elt))))) 259 STRINGP (XCAR (XCDR (elt)))))
260 { 260 {
261 *volume = XCAR (elt); 261 *volume = XCAR (elt);
262 *sound = XCAR (XCDR (elt)); 262 *sound = XCAR (XCDR (elt));
263 } 263 }
264 else if ((SYMBOLP (XCAR (elt)) || /* ( name <sound> . <vol> ) */ 264 else if ((SYMBOLP (XCAR (elt)) || /* ( name <sound> . <vol> ) */
265 STRINGP (XCAR (elt))) && 265 STRINGP (XCAR (elt))) &&
266 INT_OR_FLOATP (XCDR (elt))) 266 FIXNUM_OR_FLOATP (XCDR (elt)))
267 { 267 {
268 *sound = XCAR (elt); 268 *sound = XCAR (elt);
269 *volume = XCDR (elt); 269 *volume = XCDR (elt);
270 } 270 }
271 #if 0 /* this one is ambiguous with the plist form */ 271 #if 0 /* this one is ambiguous with the plist form */
272 else if ((SYMBOLP (XCAR (elt)) || /* ( name <sound> <vol> ) */ 272 else if ((SYMBOLP (XCAR (elt)) || /* ( name <sound> <vol> ) */
273 STRINGP (XCAR (elt))) && 273 STRINGP (XCAR (elt))) &&
274 CONSP (XCDR (elt)) && 274 CONSP (XCDR (elt)) &&
275 NILP (XCDR (XCDR (elt))) && 275 NILP (XCDR (XCDR (elt))) &&
276 INT_OR_FLOATP (XCAR (XCDR (elt)))) 276 FIXNUM_OR_FLOATP (XCAR (XCDR (elt))))
277 { 277 {
278 *sound = XCAR (elt); 278 *sound = XCAR (elt);
279 *volume = XCAR (XCDR (elt)); 279 *volume = XCAR (XCDR (elt));
280 } 280 }
281 #endif /* 0 */ 281 #endif /* 0 */
290 return; 290 return;
291 elt = XCDR (val); 291 elt = XCDR (val);
292 val = XCAR (val); 292 val = XCAR (val);
293 if (EQ (key, Q_volume)) 293 if (EQ (key, Q_volume))
294 { 294 {
295 if (INT_OR_FLOATP (val)) *volume = val; 295 if (FIXNUM_OR_FLOATP (val)) *volume = val;
296 } 296 }
297 else if (EQ (key, Q_pitch)) 297 else if (EQ (key, Q_pitch))
298 { 298 {
299 if (INT_OR_FLOATP (val)) *pitch = val; 299 if (FIXNUM_OR_FLOATP (val)) *pitch = val;
300 if (NILP (*sound)) *sound = Qt; 300 if (NILP (*sound)) *sound = Qt;
301 } 301 }
302 else if (EQ (key, Q_duration)) 302 else if (EQ (key, Q_duration))
303 { 303 {
304 if (INT_OR_FLOATP (val)) *duration = val; 304 if (FIXNUM_OR_FLOATP (val)) *duration = val;
305 if (NILP (*sound)) *sound = Qt; 305 if (NILP (*sound)) *sound = Qt;
306 } 306 }
307 else if (EQ (key, Q_sound)) 307 else if (EQ (key, Q_sound))
308 { 308 {
309 if (SYMBOLP (val) || STRINGP (val)) *sound = val; 309 if (SYMBOLP (val) || STRINGP (val)) *sound = val;
364 sound = Qdefault; 364 sound = Qdefault;
365 goto try_it_again; 365 goto try_it_again;
366 } 366 }
367 367
368 368
369 vol = (INT_OR_FLOATP (volume) ? (int) XFLOATINT (volume) : bell_volume); 369 vol = (FIXNUM_OR_FLOATP (volume) ? (int) XFLOATFIXNUM (volume) : bell_volume);
370 pit = (INT_OR_FLOATP (pitch) ? (int) XFLOATINT (pitch) : -1); 370 pit = (FIXNUM_OR_FLOATP (pitch) ? (int) XFLOATFIXNUM (pitch) : -1);
371 dur = (INT_OR_FLOATP (duration) ? (int) XFLOATINT (duration) : -1); 371 dur = (FIXNUM_OR_FLOATP (duration) ? (int) XFLOATFIXNUM (duration) : -1);
372 372
373 /* If the sound is a string, and we're connected to ALSA, NAS, or ESD, do 373 /* If the sound is a string, and we're connected to ALSA, NAS, or ESD, do
374 that. Else if the sound is a string, and we're on console, play it 374 that. Else if the sound is a string, and we're on console, play it
375 natively. Else just beep. 375 natively. Else just beep.
376 */ 376 */