playmus.c
changeset 83 c95d43cc6d38
parent 75 6024df94730b
child 138 4d0dc6b4985d
     1.1 --- a/playmus.c	Thu Apr 05 21:18:09 2001 +0000
     1.2 +++ b/playmus.c	Thu Apr 05 21:25:56 2001 +0000
     1.3 @@ -130,18 +130,18 @@
     1.4  			audio_format = AUDIO_U8;
     1.5  		} else {
     1.6  			Usage(argv[0]);
     1.7 -			exit(1);
     1.8 +			return(1);
     1.9  		}
    1.10  	}
    1.11  	if ( ! argv[i] ) {
    1.12  		Usage(argv[0]);
    1.13 -		exit(1);
    1.14 +		return(1);
    1.15  	}
    1.16  
    1.17  	/* Initialize the SDL library */
    1.18  	if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
    1.19  		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
    1.20 -		exit(255);
    1.21 +		return(255);
    1.22  	}
    1.23  	atexit(CleanUp);
    1.24  	signal(SIGINT, IntHandler);
    1.25 @@ -150,7 +150,7 @@
    1.26  	/* Open the audio device */
    1.27  	if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) < 0) {
    1.28  		fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
    1.29 -		exit(2);
    1.30 +		return(2);
    1.31  	} else {
    1.32  		Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
    1.33  		printf("Opened audio at %d Hz %d bit %s, %d bytes audio buffer\n", audio_rate,
    1.34 @@ -171,7 +171,7 @@
    1.35  		if ( music == NULL ) {
    1.36  			fprintf(stderr, "Couldn't load %s: %s\n",
    1.37  				argv[i], SDL_GetError());
    1.38 -			exit(2);
    1.39 +			return(2);
    1.40  		}
    1.41  		
    1.42  		/* Play and then exit */
    1.43 @@ -191,5 +191,5 @@
    1.44  		
    1.45  		i++;
    1.46  	}
    1.47 -	exit(0);
    1.48 +	return(0);
    1.49  }