aboutsummaryrefslogtreecommitdiffstats
path: root/src/sound.c
diff options
context:
space:
mode:
authorPaul Eggert2011-04-15 01:47:25 -0700
committerPaul Eggert2011-04-15 01:47:25 -0700
commita0238ccadcb6bf4eaf5caaced7d3904458a698db (patch)
treee714e625ddc8cc722c2714ffa2b6caeecb4b0e11 /src/sound.c
parent3d6c25432149acdf5c3c3eb11f4857922dab089c (diff)
downloademacs-a0238ccadcb6bf4eaf5caaced7d3904458a698db.tar.gz
emacs-a0238ccadcb6bf4eaf5caaced7d3904458a698db.zip
* sound.c: Use EMACS_INT rather than size_t.
Diffstat (limited to 'src/sound.c')
-rw-r--r--src/sound.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/sound.c b/src/sound.c
index 55207ddcf51..794c8e64e54 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -235,11 +235,11 @@ struct sound_device
235 235
236 /* Return a preferred data size in bytes to be sent to write (below) 236 /* Return a preferred data size in bytes to be sent to write (below)
237 each time. 2048 is used if this is NULL. */ 237 each time. 2048 is used if this is NULL. */
238 size_t (* period_size) (struct sound_device *sd); 238 EMACS_INT (* period_size) (struct sound_device *sd);
239 239
240 /* Write NYBTES bytes from BUFFER to device SD. */ 240 /* Write NYBTES bytes from BUFFER to device SD. */
241 void (* write) (struct sound_device *sd, const char *buffer, 241 void (* write) (struct sound_device *sd, const char *buffer,
242 size_t nbytes); 242 EMACS_INT nbytes);
243 243
244 /* A place for devices to store additional data. */ 244 /* A place for devices to store additional data. */
245 void *data; 245 void *data;
@@ -291,7 +291,7 @@ static void vox_configure (struct sound_device *);
291static void vox_close (struct sound_device *sd); 291static void vox_close (struct sound_device *sd);
292static void vox_choose_format (struct sound_device *, struct sound *); 292static void vox_choose_format (struct sound_device *, struct sound *);
293static int vox_init (struct sound_device *); 293static int vox_init (struct sound_device *);
294static void vox_write (struct sound_device *, const char *, size_t); 294static void vox_write (struct sound_device *, const char *, EMACS_INT);
295static void find_sound_type (struct sound *); 295static void find_sound_type (struct sound *);
296static u_int32_t le2hl (u_int32_t); 296static u_int32_t le2hl (u_int32_t);
297static u_int16_t le2hs (u_int16_t); 297static u_int16_t le2hs (u_int16_t);
@@ -600,9 +600,9 @@ wav_play (struct sound *s, struct sound_device *sd)
600 else 600 else
601 { 601 {
602 char *buffer; 602 char *buffer;
603 ssize_t nbytes = 0; 603 EMACS_INT nbytes = 0;
604 size_t blksize = sd->period_size ? sd->period_size (sd) : 2048; 604 EMACS_INT blksize = sd->period_size ? sd->period_size (sd) : 2048;
605 size_t data_left = header->data_length; 605 EMACS_INT data_left = header->data_length;
606 606
607 buffer = (char *) alloca (blksize); 607 buffer = (char *) alloca (blksize);
608 lseek (s->fd, sizeof *header, SEEK_SET); 608 lseek (s->fd, sizeof *header, SEEK_SET);
@@ -690,9 +690,9 @@ au_play (struct sound *s, struct sound_device *sd)
690 SBYTES (s->data) - header->data_offset); 690 SBYTES (s->data) - header->data_offset);
691 else 691 else
692 { 692 {
693 size_t blksize = sd->period_size ? sd->period_size (sd) : 2048; 693 EMACS_INT blksize = sd->period_size ? sd->period_size (sd) : 2048;
694 char *buffer; 694 char *buffer;
695 ssize_t nbytes; 695 EMACS_INT nbytes;
696 696
697 /* Seek */ 697 /* Seek */
698 lseek (s->fd, header->data_offset, SEEK_SET); 698 lseek (s->fd, header->data_offset, SEEK_SET);
@@ -895,7 +895,7 @@ vox_init (struct sound_device *sd)
895/* Write NBYTES bytes from BUFFER to device SD. */ 895/* Write NBYTES bytes from BUFFER to device SD. */
896 896
897static void 897static void
898vox_write (struct sound_device *sd, const char *buffer, size_t nbytes) 898vox_write (struct sound_device *sd, const char *buffer, EMACS_INT nbytes)
899{ 899{
900 if (emacs_write (sd->fd, buffer, nbytes) != nbytes) 900 if (emacs_write (sd->fd, buffer, nbytes) != nbytes)
901 sound_perror ("Error writing to sound device"); 901 sound_perror ("Error writing to sound device");
@@ -952,7 +952,7 @@ alsa_open (struct sound_device *sd)
952 alsa_sound_perror (file, err); 952 alsa_sound_perror (file, err);
953} 953}
954 954
955static size_t 955static EMACS_INT
956alsa_period_size (struct sound_device *sd) 956alsa_period_size (struct sound_device *sd)
957{ 957{
958 struct alsa_params *p = (struct alsa_params *) sd->data; 958 struct alsa_params *p = (struct alsa_params *) sd->data;
@@ -1155,13 +1155,13 @@ alsa_choose_format (struct sound_device *sd, struct sound *s)
1155/* Write NBYTES bytes from BUFFER to device SD. */ 1155/* Write NBYTES bytes from BUFFER to device SD. */
1156 1156
1157static void 1157static void
1158alsa_write (struct sound_device *sd, const char *buffer, size_t nbytes) 1158alsa_write (struct sound_device *sd, const char *buffer, EMACS_INT nbytes)
1159{ 1159{
1160 struct alsa_params *p = (struct alsa_params *) sd->data; 1160 struct alsa_params *p = (struct alsa_params *) sd->data;
1161 1161
1162 /* The the third parameter to snd_pcm_writei is frames, not bytes. */ 1162 /* The the third parameter to snd_pcm_writei is frames, not bytes. */
1163 int fact = snd_pcm_format_size (sd->format, 1) * sd->channels; 1163 int fact = snd_pcm_format_size (sd->format, 1) * sd->channels;
1164 size_t nwritten = 0; 1164 EMACS_INT nwritten = 0;
1165 int err; 1165 int err;
1166 1166
1167 while (nwritten < nbytes) 1167 while (nwritten < nbytes)