Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove trailing spaces in src/

  • Loading branch information...
commit 9a27e7ab6ace31abc40ad5f04740953a94c7b7bb 1 parent 0c2a2a5
@Deiz Deiz authored
View
40 src/ai.c
@@ -1210,7 +1210,7 @@ static Task* ai_createTask( lua_State *L, int subtask )
lv = lua_tovector(L,2);
vectcpy( &t->dat.vec, &lv->vec );
}
- else
+ else
NLUA_INVALID_PARAMETER(L);
}
@@ -1463,7 +1463,7 @@ static int aiL_getnearestpilot( lua_State *L )
{
dist = vect_dist(&pilot_stack[i]->solid->pos, &cur_pilot->solid->pos);
candidate_id = i;
- }
+ }
}
@@ -1476,7 +1476,7 @@ static int aiL_getnearestpilot( lua_State *L )
/* Actually found a pilot. */
lua_pushnumber(L, pilot_stack[candidate_id]->id );
return 1;
-}
+}
/*
@@ -1644,12 +1644,12 @@ static int aiL_getflybydistance( lua_State *L )
/* pilot id as parameter */
else if (lua_isnumber(L,1)) {
pilot = pilot_get( (unsigned int) lua_tonumber(L,1) );
- if (pilot==NULL) {
+ if (pilot==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
v = &pilot->solid->pos;
-
+
/*vect_cset(&v, VX(pilot->solid->pos) - VX(cur_pilot->solid->pos), VY(pilot->solid->pos) - VY(cur_pilot->solid->pos) );*/
}
else {
@@ -2087,7 +2087,7 @@ static int aiL_face( lua_State *L )
lv = lua_tovector(L,1);
tv = &lv->vec;
}
- else
+ else
NLUA_INVALID_PARAMETER(L);
/* Default gain. */
@@ -2245,7 +2245,7 @@ static int aiL_iface( lua_State *L )
if (d >= 0.) {
id = (unsigned int)d;
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -2283,7 +2283,7 @@ static int aiL_iface( lua_State *L )
number will give a more dramatic 'lead' */
speedmap = -1*copysign(1 - 1 / (fabs(drift_azimuthal/200) + 1), drift_azimuthal) * M_PI_2;
diff = angle_diff(heading_offset_azimuth, speedmap);
- azimuthal_sign = -1;
+ azimuthal_sign = -1;
/* This indicates we're drifting to the right of the target
* And we need to turn CCW */
@@ -2302,7 +2302,7 @@ static int aiL_iface( lua_State *L )
else {
/* signal that we're not in a productive direction for thrusting */
diff = M_PI;
- azimuthal_sign = 1;
+ azimuthal_sign = 1;
if(heading_offset_azimuth >0)
@@ -2322,7 +2322,7 @@ static int aiL_iface( lua_State *L )
* @luaparam p Position or id of pilot to compare facing to
* @luareturn The facing offset to the target (in degrees).
* @luafunc dir( p )
- *
+ *
*/
static int aiL_dir( lua_State *L )
{
@@ -2344,7 +2344,7 @@ static int aiL_dir( lua_State *L )
else {
id = (unsigned int)d;
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -2370,7 +2370,7 @@ static int aiL_dir( lua_State *L )
(n==-1) ? VANGLE(sv) :
vect_angle(&sv, &tv));
else /* target is static */
- diff = angle_diff( cur_pilot->solid->dir,
+ diff = angle_diff( cur_pilot->solid->dir,
(n==-1) ? VANGLE(cur_pilot->solid->pos) :
vect_angle(&cur_pilot->solid->pos, &lv->vec));
@@ -2406,7 +2406,7 @@ static int aiL_idir( lua_State *L )
if (d >= 0.) {
id = (unsigned int)d;
p = pilot_get(id);
- if (p==NULL) {
+ if (p==NULL) {
NLUA_ERROR(L, "Pilot ID does not belong to a pilot.");
return 0;
}
@@ -3091,7 +3091,7 @@ static int aiL_getweaprange( lua_State *L )
int id;
int level;
- id = cur_pilot->active_set;
+ id = cur_pilot->active_set;
level = -1;
if (lua_isnumber(L,1))
id = luaL_checkint(L,1);
@@ -3137,7 +3137,7 @@ static int aiL_canboard( lua_State *L )
/**
* @brief lua wrapper: Gets the relative size(shipmass) between the current pilot and the specified target
*
- * @param pilot_ID the ID of the pilot whose mass we will compare
+ * @param pilot_ID the ID of the pilot whose mass we will compare
* @luareturn A number from 0 to 1 mapping the relative masses
* luafunc relsize()
*/
@@ -3155,7 +3155,7 @@ static int aiL_relsize( lua_State *L )
}
lua_pushnumber(L, pilot_relsize(cur_pilot, p));
-
+
return 1;
}
@@ -3163,7 +3163,7 @@ static int aiL_relsize( lua_State *L )
/**
* @brief Gets the relative damage output(total DPS) between the current pilot and the specified target
*
- * @param pilot_ID the ID of the pilot whose DPS we will compare
+ * @param pilot_ID the ID of the pilot whose DPS we will compare
* @luareturn A number from 0 to 1 mapping the relative DPS's
* luafunc reldps()
*/
@@ -3181,7 +3181,7 @@ static int aiL_reldps( lua_State *L )
}
lua_pushnumber(L, pilot_reldps(cur_pilot, p));
-
+
return 1;
}
@@ -3189,7 +3189,7 @@ static int aiL_reldps( lua_State *L )
/**
* @brief Gets the relative HP(total shields and armor) between the current pilot and the specified target
*
- * @param pilot_ID the ID of the pilot whose HP we will compare
+ * @param pilot_ID the ID of the pilot whose HP we will compare
* @luareturn A number from 0 to 1 mapping the relative HPs
* relhp()
*/
@@ -3206,7 +3206,7 @@ static int aiL_relhp( lua_State *L )
}
lua_pushnumber(L, pilot_relhp(cur_pilot, p));
-
+
return 1;
}
View
4 src/comm.c
@@ -105,9 +105,9 @@ int comm_openPilot( unsigned int pilot )
/* Make sure pilot exists. */
if (comm_pilot == NULL)
return -1;
-
+
/* Make sure pilot in range. */
- if (!pilot_isFlag(p, PILOT_HAILING) &&
+ if (!pilot_isFlag(p, PILOT_HAILING) &&
pilot_inRangePilot( player.p, comm_pilot ) <= 0) {
player_message("\erTarget is out of communications range.");
comm_pilot = NULL;
View
2  src/dialogue.c
@@ -303,7 +303,7 @@ int dialogue_YesNoRaw( const char* caption, const char *msg )
static void dialogue_YesNoClose( unsigned int wid, char* str )
{
int *loop_done, result;
-
+
/* store the result */
if (strcmp(str,"btnYes")==0)
result = 1;
View
2  src/hook.c
@@ -147,7 +147,7 @@ int hook_load( xmlNodePtr parent );
static Mission *hook_getMission( Hook *hook );
-/**
+/**
* Adds a hook to the queue.
*/
static int hq_add( HookQueue_t *hq )
View
2  src/intro.c
@@ -291,7 +291,7 @@ static void intro_event_handler( int *stop, double *offset, double *vel )
/* Speed up the text. */
else if (event.key.keysym.sym == SDLK_DOWN) {
*vel += 8.0;
- if (*vel > 100.0)
+ if (*vel > 100.0)
*vel = 100.0;
}
View
2  src/map_overlay.c
@@ -300,7 +300,7 @@ void ovr_render( double dt )
gl_renderCross( x, y, 5., &cRadar_hilight );
gl_printRaw( &gl_smallFont, x+10., y-gl_smallFont.h/2., &cRadar_hilight, "GOTO" );
}
-
+
/* Render the player. */
gui_renderPlayer( res, 1 );
View
2  src/nfile.c
@@ -192,7 +192,7 @@ int nfile_fileExists( const char* path, ... )
return 1;
}
*/
-
+
return 0;
}
View
2  src/nlua_bkg.c
@@ -119,7 +119,7 @@ static int bkgL_image( lua_State *L )
lc = NULL;
foreground = lua_toboolean(L,6);
}
-
+
/* Create image. */
id = background_addImage( lt->tex, x, y, move, scale, (lc!=NULL) ? &lc->col : &cWhite, foreground );
lua_pushnumber(L,id);
View
2  src/nlua_camera.c
@@ -95,7 +95,7 @@ static int camL_set( lua_State *L )
speed = luaL_checkinteger(L,3);
else
speed = 2500;
-
+
/* Set the camera. */
if (lp != NULL) {
p = pilot_get( lp->pilot );
View
2  src/nlua_commodity.c
@@ -276,7 +276,7 @@ static int commodityL_priceAt( lua_State *L )
Planet *p;
StarSystem *sys;
char *sysname;
-
+
c = luaL_validcommodity(L,1);
p = luaL_validplanet(L,2);
sysname = planet_getSystem( p->name );
View
4 src/nlua_planet.c
@@ -304,7 +304,7 @@ static int planetL_get( lua_State *L )
planets = space_getFactionPlanet( &nplanets, factions, nfactions );
free(factions);
}
- else
+ else
NLUA_INVALID_PARAMETER(L); /* Bad Parameter */
/* No suitable planet found */
@@ -329,7 +329,7 @@ static int planetL_get( lua_State *L )
}
sys = system_get( sysname );
if (sys == NULL) {
- NLUA_ERROR(L, "Planet '%s' can't find system '%s'", rndplanet, sysname);
+ NLUA_ERROR(L, "Planet '%s' can't find system '%s'", rndplanet, sysname);
return 0;
}
planet.id = planet_index( pnt );
View
4 src/nlua_player.c
@@ -609,7 +609,7 @@ static int playerL_cinematics( lua_State *L )
if (f_gui)
player_setFlag( PLAYER_CINEMATICS_GUI );
-
+
if (f_2x)
player_setFlag( PLAYER_CINEMATICS_2X );
}
@@ -678,7 +678,7 @@ static int playerL_allowLand( lua_State *L )
{
int b;
const char *str;
-
+
str = NULL;
if (lua_gettop(L) > 0) {
b = lua_toboolean(L,1);
View
4 src/nlua_system.c
@@ -704,7 +704,7 @@ static int systemL_setknown( lua_State *L )
{
int b;
StarSystem *sys;
-
+
sys = luaL_validsystem(L, 1);
b = lua_toboolean(L, 2);
@@ -772,7 +772,7 @@ static int systemL_mrkRm( lua_State *L )
{
unsigned int id;
id = luaL_checklong( L, 1 );
- ovr_mrkRm( id );
+ ovr_mrkRm( id );
return 0;
}
View
2  src/nlua_tex.c
@@ -241,7 +241,7 @@ static int texL_sprites( lua_State *L )
/**
* @brief Gets the sprite that corresponds to a direction.
*
- * @usage sx, sy = t:spriteFromdir( math.pi )
+ * @usage sx, sy = t:spriteFromdir( math.pi )
*
* @luaparam t Texture to get sprite of.
* @luaparam a Direction to have sprite facing (in radians).
View
4 src/nstring.c
@@ -71,14 +71,14 @@ const char *nstrcasestr( const char *haystack, const char *needle )
return strcasestr( haystack, needle );
#else /* HAS_POSIX */
size_t hay_len, needle_len;
-
+
/* Get lengths. */
hay_len = strlen(haystack);
needle_len = strlen(needle);
/* Slow search. */
while (hay_len >= needle_len) {
- if (strncasecmp(haystack, needle, needle_len) == 0)
+ if (strncasecmp(haystack, needle, needle_len) == 0)
return haystack;
haystack++;
View
2  src/ntime.c
@@ -25,7 +25,7 @@
*
* Acronyms:
* - UST : Universal Synchronized Time
- * - STU : Smallest named time unit. Equal to the Earth second.
+ * - STU : Smallest named time unit. Equal to the Earth second.
* - STP : Most commonly used time unit. STPs are the new hours. 1 STP = 10,000 STU (about 2.8 Earth hours).
* - SCU : Used for long-term time periods. 1 SCU = 5000 STP (about 579 Earth days).
*/
View
2  src/nxml.h
@@ -41,7 +41,7 @@
/* get data different ways */
#define xml_raw(n) ((char*)(n)->children->content)
#define xml_get(n) (((n)->children == NULL) ? NULL : (char*)(n)->children->content)
-#define xml_getInt(n) ((xml_get(n) == NULL) ? 0 : strtol( xml_raw(n), (char**)NULL, 10))
+#define xml_getInt(n) ((xml_get(n) == NULL) ? 0 : strtol( xml_raw(n), (char**)NULL, 10))
#define xml_getUInt(n) ((xml_get(n) == NULL) ? 0 : strtoul( xml_raw(n), (char**)NULL, 10))
#define xml_getLong(n) ((xml_get(n) == NULL) ? 0 : strtoll( xml_raw(n), (char**)NULL, 10))
#define xml_getULong(n) ((xml_get(n) == NULL) ? 0 : strtoull(xml_raw(n), (char**)NULL, 10))
View
2  src/nxml_lua.c
@@ -79,7 +79,7 @@ static int nxml_persistDataNode( lua_State *L, xmlTextWriterPtr writer, int inta
/* Default values. */
ret = 0;
-
+
/* We recieve data in the format of: key, value */
/* key, value */
View
2  src/opengl.c
@@ -717,7 +717,7 @@ void gl_viewport( int x, int y, int w, int h )
gl_screen.nh, /* Top edge. */
-1., /* near */
1. ); /* far */
-
+
/* Take into accunt possible translation. */
gl_screen.x = x;
gl_screen.y = y;
View
2  src/opengl_render.c
@@ -1100,7 +1100,7 @@ static glTexture *gl_genCircle( int radius )
/* Return texture. */
snprintf( name, sizeof(name), "gencircle%d", radius );
- return gl_loadImagePad( name, sur, OPENGL_TEX_MIPMAPS, sur->w, sur->h, 1, 1, 1 );
+ return gl_loadImagePad( name, sur, OPENGL_TEX_MIPMAPS, sur->w, sur->h, 1, 1, 1 );
}
View
2  src/perlin.c
@@ -600,7 +600,7 @@ static int noise_genNebulaMap_thread( void *data )
/* Generate the layer. */
max = 0;
f[2] = args->zoom * (float)args->z / (float)args->n;
-
+
for (y=0; y<args->h; y++) {
f[1] = args->zoom * (float)y / (float)args->h;
View
2  src/physics.c
@@ -469,7 +469,7 @@ void solid_init( Solid* dest, const double mass, const double dir,
case SOLID_UPDATE_EULER:
dest->update = solid_update_euler;
break;
-
+
default:
WARN("Solid initialization did not specify correct update function!");
dest->update = solid_update_rk4;
View
30 src/pilot.c
@@ -295,7 +295,7 @@ unsigned int pilot_getNearestEnemy_size( const Pilot* p, int target_mass_LB, int
continue;
if ((areEnemies(p->faction, pilot_stack[i]->faction) || /* Enemy faction. */
- ((pilot_stack[i]->id == PLAYER_ID) &&
+ ((pilot_stack[i]->id == PLAYER_ID) &&
pilot_isFlag(p,PILOT_HOSTILE)))) { /* Hostile to player. */
/*mass is in bounds*/
@@ -345,23 +345,23 @@ unsigned int pilot_getNearestEnemy_heuristic(const Pilot* p, double mass_factor,
continue;
if ((areEnemies(p->faction, pilot_stack[i]->faction) || /* Enemy faction. */
- ((pilot_stack[i]->id == PLAYER_ID) &&
+ ((pilot_stack[i]->id == PLAYER_ID) &&
pilot_isFlag(p,PILOT_HOSTILE)))) { /* Hostile to player. */
-
+
/* Shouldn't be disabled. */
if (pilot_isDisabled(pilot_stack[i]))
continue;
- /* Must be in range. */
+ /* Must be in range. */
if (!pilot_inRangePilot( p, pilot_stack[i] ))
continue;
/* Check distance. */
td = vect_dist2(&pilot_stack[i]->solid->pos, &p->solid->pos)* range_factor;
temp = td+fabs( pilot_relsize(p, pilot_stack[i]) /*0.5*/-mass_factor) + fabs(pilot_relhp(p, pilot_stack[i]) /*0.5*/- health_factor) + fabs(pilot_reldps(p, pilot_stack[i]) /*0.5*/-damage_factor);
-
+
if ((tp == 0) || (temp< current_heuristic_value)) {
current_heuristic_value = temp;
tp = pilot_stack[i]->id;
@@ -1070,7 +1070,7 @@ static void pilot_dead( Pilot* p, unsigned int killer )
* @param parent The exploding pilot.
*/
void pilot_explode( double x, double y, double radius,
- DamageType dtype, double damage,
+ DamageType dtype, double damage,
double penetration, const Pilot *parent )
{
int i;
@@ -1447,7 +1447,7 @@ void pilot_update( Pilot* pilot, const double dt )
pilot_weapSetUpdate( pilot );
if (!pilot_isFlag(pilot, PILOT_HYPERSPACE)) { /* limit the speed */
-
+
/* pilot is afterburning */
if (pilot_isFlag(pilot, PILOT_AFTERBURNER) && /* must have enough energy left */
(pilot->energy > pilot->afterburner->outfit->u.afb.energy * dt)) {
@@ -2367,23 +2367,23 @@ void pilots_updateSystemFleet( const int deletedIndex ) {
/**
* @brief Gets the relative size(shipmass) between the current pilot and the specified target
*
- * @param p the pilot whose mass we will compare
+ * @param p the pilot whose mass we will compare
* @luareturn A number from 0 to 1 mapping the relative masses
* relsize()
*/
double pilot_relsize(const Pilot* cur_pilot, const Pilot* p)
{
/*double mass_map;
-
+
mass_map = 1 - 1/(1 + ( (double) cur_pilot -> solid -> mass / (double) p->solid->mass );*/
-
+
return (1 - 1/(1 + ( (double) cur_pilot -> solid -> mass / (double) p->solid->mass) ) );
}
/**
* @brief Gets the relative damage output(total DPS) between the current pilot and the specified target
*
- * @param p the pilot whose dps we will compare
+ * @param p the pilot whose dps we will compare
* @return A number from 0 to 1 mapping the relative damage output
* reldps()
*/
@@ -2407,7 +2407,7 @@ double pilot_reldps(const Pilot* cur_pilot, const Pilot* p)
for(i = 0; i < cur_pilot->outfit_nweapon; i++)
{
-
+
/*DPSaccum_pilot += ( outfit_damage(cur_pilot->outfit_weapon[i].outfit)/outfit_delay(cur_pilot->outfit_weapon[i].outfit) );*/
if(cur_pilot->outfit_weapon[i].outfit) {
@@ -2426,13 +2426,13 @@ double pilot_reldps(const Pilot* cur_pilot, const Pilot* p)
return 0;
}
-
+
/**
* @brief Gets the relative hp(combined shields and armor) between the current pilot and the specified target
*
- * @param p the pilot whose shields/armor we will compare
+ * @param p the pilot whose shields/armor we will compare
* @return A number from 0 to 1 mapping the relative HPs
- * relhp()
+ * relhp()
*/
double pilot_relhp(const Pilot* cur_pilot, const Pilot* p)
{
View
2  src/pilot.h
@@ -417,7 +417,7 @@ double pilot_relhp(const Pilot* cur_pilot, const Pilot* p);
double pilot_hit( Pilot* p, const Solid* w, const unsigned int shooter,
const DamageType dtype, const double damage, const double penetration );
void pilot_explode( double x, double y, double radius,
- DamageType dtype, double damage,
+ DamageType dtype, double damage,
double penetration, const Pilot *parent );
double pilot_face( Pilot* p, const double dir );
View
2  src/pilot_cargo.h
@@ -29,7 +29,7 @@ int pilot_cargoAddRaw( Pilot* pilot, Commodity* cargo,
int quantity, unsigned int id );
-/*
+/*
* Mission cargo - not to be confused with normal cargo.
*/
unsigned int pilot_addMissionCargo( Pilot* pilot, Commodity* cargo, int quantity );
View
4 src/pilot_heat.c
@@ -101,7 +101,7 @@ void pilot_heatCalcSlot( PilotOutfitSlot *o )
void pilot_heatReset( Pilot *p )
{
int i;
-
+
p->heat_T = CONST_SPACE_STAR_TEMP;
for (i=0; i<p->noutfits; i++)
p->outfits[i]->heat_T = CONST_SPACE_STAR_TEMP;
@@ -138,7 +138,7 @@ void pilot_heatAddSlot( Pilot *p, PilotOutfitSlot *o )
*
* q being heat flux W/m^2
* k being conductivity W/(m*K)
- * dT/dx temperature gradient along one dimension K/m
+ * dT/dx temperature gradient along one dimension K/m
*
* Slots are connected only with the chassis.
*
View
2  src/pilot_hook.h
@@ -19,7 +19,7 @@ void pilots_rmHook( unsigned int hook );
void pilot_clearHooks( Pilot *p );
-/*
+/*
* Global hooks.
*/
void pilots_addGlobalHook( int type, unsigned int hook );
View
12 src/pilot_weapon.c
@@ -426,12 +426,12 @@ static void pilot_weapSetUpdateRange( PilotWeaponSet *ws )
for (i=0; i<array_size(ws->slots); i++) {
if (ws->slots[i].slot->outfit == NULL)
continue;
-
+
/* Get level. */
lev = ws->slots[i].level;
if (lev >= PILOT_WEAPSET_MAX_LEVELS)
continue;
-
+
/* Get range. */
range = outfit_range(ws->slots[i].slot->outfit);
if (range >= 0.) {
@@ -533,7 +533,7 @@ void pilot_weapSetCleanup( Pilot* p, int id )
if (ws->slots != NULL)
array_free( ws->slots );
ws->slots = NULL;
-
+
if (ws->name != NULL)
free( ws->name );
ws->name = NULL;
@@ -631,7 +631,7 @@ void pilot_shootStop( Pilot* p, int level )
/* Only handle beams. */
if (!outfit_isBeam(ws->slots[i].slot->outfit))
continue;
-
+
/* Stop beam. */
if (ws->slots[i].slot->u.beamid > 0) {
beam_end( p->id, ws->slots[i].slot->u.beamid );
@@ -979,10 +979,10 @@ void pilot_weaponAuto( Pilot *p )
slot->level = -1;
continue;
}
-
+
/* Add to its base group. */
pilot_weapSetAdd( p, id, slot, level );
-
+
/* Also add another copy to another group. */
if (id == 1) { /* Forward. */
pilot_weapSetAdd( p, 0, slot, level ); /* Also get added to 'All'. */
View
4 src/player.c
@@ -580,7 +580,7 @@ void player_swapShip( char* shipname )
for (i=0; i<player_nstack; i++) {
if (strcmp(shipname,player_stack[i].p->name)!=0)
continue;
-
+
/* swap player and ship */
ship = player_stack[i].p;
@@ -3619,7 +3619,7 @@ static int player_parseShip( xmlNodePtr parent, int is_player, char *planet )
/* Only weapon nodes. */
if (!xml_isNode(ccur,"weapon")) {
- WARN("Player ship '%s' has unknown 'weaponset' child node '%s' (expected 'weapon').",
+ WARN("Player ship '%s' has unknown 'weaponset' child node '%s' (expected 'weapon').",
ship->name, ccur->name );
continue;
}
View
4 src/player_autonav.c
@@ -227,7 +227,7 @@ static void player_autonav (void)
tc_down = (tc_mod-1.) / 3.;
}
break;
-
+
case AUTONAV_POS_APPROACH:
ret = player_autonavApproach( &player.autonav_pos, &d, 1 );
if (ret) {
@@ -414,7 +414,7 @@ void player_updateAutonav( double dt )
return;
else
tc_mod += 0.2 * dt * (player.tc_max-1.);
- /* Avoid going over. */
+ /* Avoid going over. */
if (tc_mod > player.tc_max)
tc_mod = player.tc_max;
pause_setSpeed( tc_mod );
View
4 src/sound_openal.c
@@ -285,7 +285,7 @@ int sound_al_init (void)
* gain = distance_function( CLAMP( AL_REFERENCE_DISTANCE, AL_MAX_DISTANCE, distance ) );
*
* Distance functions:
- * AL_REFERENCE_DISTANCE
+ * AL_REFERENCE_DISTANCE
* * Inverse = ------------------------------------------------------------------------------
* AL_REFERENCE_DISTANCE + AL_ROLLOFF_FACTOR ( distance - AL_REFERENCE_DISTANCE )
*
@@ -557,7 +557,7 @@ static int sound_al_loadWav( alSound *snd, SDL_RWops *rw )
/* Handle format. */
switch (wav_spec.format) {
case AUDIO_U8:
- case AUDIO_S8:
+ case AUDIO_S8:
format = (wav_spec.channels==1) ? AL_FORMAT_MONO8 : AL_FORMAT_STEREO8;
break;
case AUDIO_U16LSB:
View
2  src/start.c
@@ -100,7 +100,7 @@ int start_load (void)
xmlr_uint( cur, "credits", start_data.credits );
xmlr_strd( cur, "mission", start_data.mission );
xmlr_strd( cur, "event", start_data.event );
-
+
if (xml_isNode(cur,"system")) {
tmp = cur->children;
do {
View
2  src/tech.c
@@ -254,7 +254,7 @@ static char* tech_getItemName( tech_item_t *item )
return item->u.comm->name;
case TECH_TYPE_GROUP:
return tech_groups[ item->u.grp ].name;
- case TECH_TYPE_GROUP_POINTER:
+ case TECH_TYPE_GROUP_POINTER:
return item->u.grpptr->name;
}
View
44 src/threadpool.c
@@ -46,7 +46,7 @@ struct ThreadQueue_ {
Node *first; /* The first node */
Node *last; /* The second node */
/* A semaphore to ensure reads only happen when the queue is not empty */
- SDL_sem *semaphore;
+ SDL_sem *semaphore;
SDL_mutex *t_lock; /* Tail lock. Lock when reading/updating tail */
SDL_mutex *h_lock; /* Same as tail lock, except it's head lock */
};
@@ -99,7 +99,7 @@ static int threadpool_handler( void *data );
static int vpool_worker( void *data );
-/**
+/**
* @brief Creates a concurrent queue.
* @return The ThreadQueue.
*/
@@ -165,7 +165,7 @@ static void* tq_dequeue( ThreadQueue *q )
{
void *d;
Node *newhead, *node;
-
+
/* Lock the head. */
SDL_mutexP( q->h_lock );
@@ -187,7 +187,7 @@ static void* tq_dequeue( ThreadQueue *q )
/* Remember the value and assign newhead as the new dummy element. */
d = newhead->data;
q->first = newhead;
-
+
/* Unlock */
SDL_mutexV( q->h_lock );
@@ -195,7 +195,7 @@ static void* tq_dequeue( ThreadQueue *q )
return d;
}
-/**
+/**
* @brief Destroy and free a ThreadQueue.
* Frees all elements too.
*
@@ -212,16 +212,16 @@ static void tq_destroy( ThreadQueue *q )
while(q->first->next != NULL) {
free( tq_dequeue(q) );
}
-
+
free( q->first );
free( q );
}
/**
- * @brief Enqueues a new job for the threadpool.
+ * @brief Enqueues a new job for the threadpool.
* @warning Do NOT enqueue a job that has to wait for another job to be done as
- * this could lead to a deadlock.
+ * this could lead to a deadlock.
*
* @param function The function (job) to be called (executed).
* @param data The arguments for the function.
@@ -236,7 +236,7 @@ int threadpool_newJob( int (*function)(void *), void *data )
WARN("Threadpool has not been initialized yet!");
return -2;
}
-
+
/* Allocate nad sett parameters. */
node = calloc( 1, sizeof(ThreadQueueData) );
node->data = data;
@@ -244,7 +244,7 @@ int threadpool_newJob( int (*function)(void *), void *data )
/* Actually enque. */
tq_enqueue( global_queue, node );
-
+
return 0;
}
@@ -260,7 +260,7 @@ int threadpool_newJob( int (*function)(void *), void *data )
static int threadpool_worker( void *data )
{
ThreadData *work;
-
+
work = (ThreadData*) data;
/* Work loop */
@@ -278,7 +278,7 @@ static int threadpool_worker( void *data )
/* Do work :-) */
work->function( work->data );
-
+
/* Enqueue itself in the idle worker threads queue */
tq_enqueue( work->idle, work );
}
@@ -291,7 +291,7 @@ static int threadpool_worker( void *data )
/**
* @brief Handles assigning jobs to the workers and killing them if necessary.
* Stopping the threeadpool_handler is not yet implemented.
- *
+ *
* @param data Not used. SDL threading requires functions to take a void
* pointer as argument.
*
@@ -305,7 +305,7 @@ static int threadpool_handler( void *data )
/* Queues for idle workers and stopped workers */
ThreadQueue *idle, *stopped;
ThreadQueueData *node;
-
+
/* Initialize the idle and stopped queues. */
idle = tq_create();
stopped = tq_create();
@@ -358,7 +358,7 @@ static int threadpool_handler( void *data )
}
/* We got work. Continue to handle work. */
- }
+ }
else {
/*
* Here we wait for a new job. No threads are alive at this point and the
@@ -378,7 +378,7 @@ static int threadpool_handler( void *data )
* be created.
*/
- /*
+ /*
* Get a new job from the queue. This should be safe as we have received
* a permission from the global_queue->semaphore.
*/
@@ -397,7 +397,7 @@ static int threadpool_handler( void *data )
threadarg = tq_dequeue( stopped );
threadarg->signal = THREADSIG_RUN;
newthread = 1;
- }
+ }
/* Wait for idle thread */
else {
while (SDL_SemWait(idle->semaphore) == -1) {
@@ -453,7 +453,7 @@ int threadpool_init (void)
* This is just an interface to make running a number of jobs and then wait for
* them to finish more pleasant. You should not nest vpools as of now as there
* are only a limit number of worker threads and we can't have them wait for a
- * thread to finish that doesn't exist.
+ * thread to finish that doesn't exist.
* If you really want to sort of nest vpools, you should start a new thread
* instead of using the threadpool. I might add a vpool_waitInANewThread
* function some day.
@@ -475,12 +475,12 @@ ThreadQueue* vpool_create (void)
void vpool_enqueue( ThreadQueue *queue, int (*function)(void *), void *data )
{
ThreadQueueData *node;
-
+
/* Allocate and set up data. */
node = calloc( 1, sizeof(ThreadQueueData) );
node->data = data;
node->function = function;
-
+
tq_enqueue( queue, node );
}
@@ -492,7 +492,7 @@ void vpool_enqueue( ThreadQueue *queue, int (*function)(void *), void *data )
static int vpool_worker( void *data )
{
vpoolThreadData *work;
-
+
work = (vpoolThreadData*) data;
/* Do work */
@@ -500,7 +500,7 @@ static int vpool_worker( void *data )
/* Decrement the counter and signal vpool_wait if all threads are done */
SDL_mutexP( work->mutex );
- *(work->count) = *(work->count) - 1;
+ *(work->count) = *(work->count) - 1;
if (*(work->count) == 0) /* All jobs are done */
SDL_CondSignal( work->cond ); /* Signal waiting thread */
SDL_mutexV( work->mutex );
Please sign in to comment.
Something went wrong with that request. Please try again.