From 243a15052f4ec2716d35125609e9184d05fb8da9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 22 May 2010 15:40:35 +0200 Subject: [PATCH] Convert spaces to tabs --- src/client/play.c | 24 ++++---- src/lib/as/as.h | 2 +- src/lib/commands/conv.c | 2 +- src/lib/commands/coun.c | 2 +- src/lib/commands/load.c | 14 ++--- src/lib/commands/navi.c | 12 ++-- src/lib/commands/vers.c | 2 +- src/lib/common/ef_verify.c | 2 +- src/lib/common/xundump.c | 6 +- src/lib/empthread/ntthread.c | 2 +- src/lib/global/constants.c | 4 +- src/lib/player/empdis.c | 4 +- src/lib/subs/mission.c | 2 +- src/lib/subs/pr.c | 6 +- src/lib/subs/unitsub.c | 2 +- src/lib/update/sail.c | 2 +- src/lib/update/ship.c | 2 +- src/lib/w32/service.c | 106 +++++++++++++++++------------------ src/server/main.c | 4 +- 19 files changed, 100 insertions(+), 100 deletions(-) diff --git a/src/client/play.c b/src/client/play.c index b1a2763f3..a550eebbd 100644 --- a/src/client/play.c +++ b/src/client/play.c @@ -273,21 +273,21 @@ w32_ring_from_file_or_bounce_buf(struct ring *r, int fd) int i, res; if (fd) - return ring_from_file(r, fd); + return ring_from_file(r, fd); if (bounce_status < 0) { - errno = bounce_error; - res = bounce_status; + errno = bounce_error; + res = bounce_status; } else { - for (i = 0; i < bounce_status; i++) { - if (ring_putc(r, bounce_buf[i]) == EOF) { - /* more work to do, hold on to bounce_buf */ - memmove(bounce_buf, bounce_buf + i, bounce_status - i); - bounce_status -= i; - return i; - } - } - res = i; + for (i = 0; i < bounce_status; i++) { + if (ring_putc(r, bounce_buf[i]) == EOF) { + /* more work to do, hold on to bounce_buf */ + memmove(bounce_buf, bounce_buf + i, bounce_status - i); + bounce_status -= i; + return i; + } + } + res = i; } ResetEvent(bounce_full); diff --git a/src/lib/as/as.h b/src/lib/as/as.h index d084e575c..981fa6c28 100644 --- a/src/lib/as/as.h +++ b/src/lib/as/as.h @@ -142,7 +142,7 @@ struct as_frompath { AS_NEW_ARRAY((p), type, 1, err); #define AS_NEW_MALLOC(p, type, err) \ - (p) = (type *)malloc(sizeof(type)); \ + (p) = (type *)malloc(sizeof(type)); \ if ((p) == NULL) \ return err; \ diff --git a/src/lib/commands/conv.c b/src/lib/commands/conv.c index f71c41087..6aeafec67 100644 --- a/src/lib/commands/conv.c +++ b/src/lib/commands/conv.c @@ -64,7 +64,7 @@ conv(void) continue; if (sect.sct_oldown == player->cnum) continue; - natp = getnatp(sect.sct_own); + natp = getnatp(sect.sct_own); maxpop = max_pop(natp->nat_level[NAT_RLEV], §); civ = sect.sct_item[I_CIVIL]; mil = sect.sct_item[I_MILIT]; diff --git a/src/lib/commands/coun.c b/src/lib/commands/coun.c index 0ecc719bd..1464d77b4 100644 --- a/src/lib/commands/coun.c +++ b/src/lib/commands/coun.c @@ -69,7 +69,7 @@ coun_list(struct natstr *natp) && (player->god || natp->nat_stat == STAT_GOD || cn == player->cnum || getrel(natp, player->cnum) == ALLIED)) - pr(" Now logged on "); + pr(" Now logged on "); else if (player->god) { if (natp->nat_last_login == 0) pr(" Never logged on "); diff --git a/src/lib/commands/load.c b/src/lib/commands/load.c index 41a288b4b..c6e41f091 100644 --- a/src/lib/commands/load.c +++ b/src/lib/commands/load.c @@ -319,7 +319,7 @@ lload(void) static int move_amount(int sect_amt, int unit_amt, int unit_max, - int load_unload, int amount) + int load_unload, int amount) { int move_amt; @@ -641,11 +641,11 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy, land.lnd_harden = 0; putland(land.lnd_uid, &land); #if 0 - /* - * FIXME if this supplies from the sector, the putsect in - * load() / lload() duplicates those supplies, causing a - * seqno mismatch - */ + /* + * FIXME if this supplies from the sector, the putsect in + * load() / lload() duplicates those supplies, causing a + * seqno mismatch + */ if (!lnd_supply_all(&land)) pr("WARNING: %s is out of supply!\n", prland(&land)); #else @@ -995,7 +995,7 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy, land.lnd_harden = 0; putland(land.lnd_uid, &land); #if 0 - /* FIXME same issue as in load_land_ship() */ + /* FIXME same issue as in load_land_ship() */ if (!lnd_supply_all(&land)) pr("WARNING: %s is out of supply!\n", prland(&land)); #else diff --git a/src/lib/commands/navi.c b/src/lib/commands/navi.c index f1fbebe04..bf7eb82e9 100644 --- a/src/lib/commands/navi.c +++ b/src/lib/commands/navi.c @@ -359,11 +359,11 @@ switch_leader(struct emp_qelem *list, int uid) save = qp = list->q_back; do { - emp_remque(qp); - emp_insque(qp, list); - qp = list->q_back; - ulp = (struct ulist *)qp; - if (ulp->unit.gen.uid == uid || uid == -1) - break; + emp_remque(qp); + emp_insque(qp, list); + qp = list->q_back; + ulp = (struct ulist *)qp; + if (ulp->unit.gen.uid == uid || uid == -1) + break; } while (list->q_back != save); } diff --git a/src/lib/commands/vers.c b/src/lib/commands/vers.c index 27b1b4a03..5a1cbd009 100644 --- a/src/lib/commands/vers.c +++ b/src/lib/commands/vers.c @@ -155,7 +155,7 @@ vers(void) pr("The maximum amount of mobility used for land unit combat is %0.2f.\n", combat_mob); if (opt_MOB_ACCESS) - pr("The starting mobility when acquiring a sector or unit is %d.\n", + pr("The starting mobility when acquiring a sector or unit is %d.\n", -(etu_per_update / sect_mob_neg_factor)); pr("\n"); pr("Ships on autonavigation may use %i cargo holds per ship.\n", TMAX); diff --git a/src/lib/common/ef_verify.c b/src/lib/common/ef_verify.c index 08a711a2f..55f9ee0bc 100644 --- a/src/lib/common/ef_verify.c +++ b/src/lib/common/ef_verify.c @@ -179,7 +179,7 @@ verify_row(int type, int row) } while (++j < n); } if (!(flags & EFF_MEM)) - free(row_ref); + free(row_ref); return ret_val; } diff --git a/src/lib/common/xundump.c b/src/lib/common/xundump.c index b3d5af89e..05a0b1977 100644 --- a/src/lib/common/xundump.c +++ b/src/lib/common/xundump.c @@ -766,9 +766,9 @@ xuheader(FILE *fp, int expected_table) human = ch == 'c'; res = -1; if ((human - ? fscanf(fp, "config%*[ \t]%63[^ \t#\n]%n", name, &res) != 1 - : fscanf(fp, "XDUMP%*[ \t]%63[^ \t#\n]%*[ \t]%*[^ \t#\n]%n", - name, &res) != 1) || res < 0) + ? fscanf(fp, "config%*[ \t]%63[^ \t#\n]%n", name, &res) != 1 + : fscanf(fp, "XDUMP%*[ \t]%63[^ \t#\n]%*[ \t]%*[^ \t#\n]%n", + name, &res) != 1) || res < 0) return gripe("Expected xdump header"); type = ef_byname(name); diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index c460e0878..4972db2e7 100644 --- a/src/lib/empthread/ntthread.c +++ b/src/lib/empthread/ntthread.c @@ -376,7 +376,7 @@ empth_init(void **ctx_ptr, int flags) /* Manual reset */ hShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if (!hShutdownEvent) { - logerror("Failed to create shutdown event %lu", GetLastError()); + logerror("Failed to create shutdown event %lu", GetLastError()); return 0; } SetConsoleCtrlHandler(loc_Exit_Handler, TRUE); diff --git a/src/lib/global/constants.c b/src/lib/global/constants.c index 4c8675581..5bd4449b4 100644 --- a/src/lib/global/constants.c +++ b/src/lib/global/constants.c @@ -135,9 +135,9 @@ double bankint = 0.25; /* bank interest rate (dt * bars) */ /* Note in the taxes below: tradetax - this is charged to the seller, so it is < 1 (because the seller - gets the (price paid * tradetax) + gets the (price paid * tradetax) buytax - this is charged to the buyer, so it is > 1 (because the buyer is - charged (price paid * buytax). + charged (price paid * buytax). Not perfect, but it works. :) */ double tradetax = 0.99; /* Tax charged on trade */ diff --git a/src/lib/player/empdis.c b/src/lib/player/empdis.c index 238812c1b..d771d08cf 100644 --- a/src/lib/player/empdis.c +++ b/src/lib/player/empdis.c @@ -209,9 +209,9 @@ update_timeused(time_t now) time_t dt = now - player->lasttime; if (dt > midnight_secs) - natp->nat_timeused = midnight_secs; + natp->nat_timeused = midnight_secs; else - natp->nat_timeused += dt; + natp->nat_timeused += dt; player->lasttime = now; putnat(natp); } diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index 2bff3f38e..bac815886 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -605,7 +605,7 @@ perform_mission_msl(int dam, struct emp_qelem *missiles, coord x, coord y, use_up_msl: plp->plane.pln_effic = 0; putplane(plp->plane.pln_uid, &plp->plane); - } + } emp_remque(qp); free(qp); } diff --git a/src/lib/subs/pr.c b/src/lib/subs/pr.c index 215e46ca7..d87dabbe0 100644 --- a/src/lib/subs/pr.c +++ b/src/lib/subs/pr.c @@ -88,7 +88,7 @@ pr(char *format, ...) upr_player(player, C_DATA, buf); else /* normal text and user text are identical */ - pr_player(player, C_DATA, buf); + pr_player(player, C_DATA, buf); } /* @@ -621,9 +621,9 @@ ufindpfx(char *s, int n) while (n && s[i]) { if ((s[i++] & 0xc0) == 0xc0) - while ((s[i] & 0xc0) == 0x80) + while ((s[i] & 0xc0) == 0x80) i++; - --n; + --n; } return i; } diff --git a/src/lib/subs/unitsub.c b/src/lib/subs/unitsub.c index 4563b2949..a87e43822 100644 --- a/src/lib/subs/unitsub.c +++ b/src/lib/subs/unitsub.c @@ -63,7 +63,7 @@ unit_list(struct emp_qelem *unit_list) if (type == EF_LAND) pr("lnd# land type x,y a eff sh gun xl mu tech retr\n"); else - pr("shp# ship type x,y fl eff mil sh gun pn he xl ln mob tech\n"); + pr("shp# ship type x,y fl eff mil sh gun pn he xl ln mob tech\n"); for (; qp != unit_list; qp = next) { next = qp->q_back; diff --git a/src/lib/update/sail.c b/src/lib/update/sail.c index 3a93c07b5..c49db293b 100644 --- a/src/lib/update/sail.c +++ b/src/lib/update/sail.c @@ -248,7 +248,7 @@ sail_nav_fleet(struct fltheadstr *fltp) fe->num, cname(fe->own)); error = 1; } - if ((shp_check_nav(sectp, sp) == CN_LANDLOCKED) && + if ((shp_check_nav(sectp, sp) == CN_LANDLOCKED) && (dchr[sectp->sct_type].d_nav == NAV_CANAL)) { wu(0, fltp->own, "Your ship #%d (%s) is too big to fit through the canal.\n", diff --git a/src/lib/update/ship.c b/src/lib/update/ship.c index 7cf9b284a..38edf91a6 100644 --- a/src/lib/update/ship.c +++ b/src/lib/update/ship.c @@ -147,7 +147,7 @@ upd_ship(struct shpstr *sp, int etus, product = &pchr[dchr[SCT_OIL].d_prd]; oil_gained = roundavg(total_work(100, etus, sp->shp_item[I_CIVIL], - sp->shp_item[I_MILIT], + sp->shp_item[I_MILIT], sp->shp_item[I_UW], ITEM_MAX) * sp->shp_effic / 100.0 diff --git a/src/lib/w32/service.c b/src/lib/w32/service.c index 495f46681..b2f0927e9 100644 --- a/src/lib/w32/service.c +++ b/src/lib/w32/service.c @@ -56,35 +56,35 @@ install_service(char *program_name, char *service_name, char *config_file) schSCManager = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); if (schSCManager == NULL) { - fprintf(stderr, "install_service failed to open Service Control Manager\n"); + fprintf(stderr, "install_service failed to open Service Control Manager\n"); return EXIT_FAILURE; } schService = CreateService(schSCManager, service_name, service_name, /* service name to display */ - SERVICE_ALL_ACCESS, /* desired access */ - SERVICE_WIN32_OWN_PROCESS, /* service type */ - SERVICE_AUTO_START, /* start type */ - SERVICE_ERROR_NORMAL, /* error control type */ - program_name, /* service's binary */ - NULL, /* no load ordering group */ - NULL, /* no tag identifier */ - NULL, /* database service dependency */ - NULL, /* LocalSystem account */ - NULL); /* no password */ + SERVICE_ALL_ACCESS, /* desired access */ + SERVICE_WIN32_OWN_PROCESS, /* service type */ + SERVICE_AUTO_START, /* start type */ + SERVICE_ERROR_NORMAL, /* error control type */ + program_name, /* service's binary */ + NULL, /* no load ordering group */ + NULL, /* no tag identifier */ + NULL, /* database service dependency */ + NULL, /* LocalSystem account */ + NULL); /* no password */ if (schService == NULL) { fprintf(stderr, "install_service failed to create service %s\n", service_name); - return EXIT_FAILURE; + return EXIT_FAILURE; } sdBuf.lpDescription = "Server for Empire game"; if(!ChangeServiceConfig2( - schService, /* handle to service */ - SERVICE_CONFIG_DESCRIPTION, /* change: description */ - &sdBuf)) { /* value: new description */ - fprintf(stderr, "install_service failed to set the description\n"); + schService, /* handle to service */ + SERVICE_CONFIG_DESCRIPTION, /* change: description */ + &sdBuf)) { /* value: new description */ + fprintf(stderr, "install_service failed to set the description\n"); } printf("Service %s installed.\n", service_name); @@ -106,28 +106,28 @@ remove_service(char *service_name) schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (schSCManager == NULL) { - fprintf(stderr, "remove_service failed to open Service Control Manager\n"); + fprintf(stderr, "remove_service failed to open Service Control Manager\n"); return EXIT_FAILURE; } hService = OpenService(schSCManager, service_name, SERVICE_ALL_ACCESS); if (hService == NULL) { - fprintf(stderr, "remove_service failed to open service %s\n", service_name); + fprintf(stderr, "remove_service failed to open service %s\n", service_name); return EXIT_FAILURE; } if (DeleteService(hService) == 0) { - fprintf(stderr, "remove_service failed to remove service %s\n", service_name); + fprintf(stderr, "remove_service failed to remove service %s\n", service_name); return EXIT_FAILURE; } if (CloseServiceHandle(hService) == 0) { - fprintf(stderr, "remove_service failed to close service %s\n", service_name); - return EXIT_FAILURE; + fprintf(stderr, "remove_service failed to close service %s\n", service_name); + return EXIT_FAILURE; } else { - printf("Service %s removed.\n", service_name); - return EXIT_SUCCESS; + printf("Service %s removed.\n", service_name); + return EXIT_SUCCESS; } } @@ -138,33 +138,33 @@ static void WINAPI service_ctrl_handler(DWORD Opcode) { switch(Opcode) { - case SERVICE_CONTROL_PAUSE: - service_status.dwCurrentState = SERVICE_PAUSED; + case SERVICE_CONTROL_PAUSE: + service_status.dwCurrentState = SERVICE_PAUSED; logerror("Pausing the service not supported"); - break; + break; - case SERVICE_CONTROL_CONTINUE: + case SERVICE_CONTROL_CONTINUE: logerror("Continuing the service not supported"); - service_status.dwCurrentState = SERVICE_RUNNING; - break; + service_status.dwCurrentState = SERVICE_RUNNING; + break; - case SERVICE_CONTROL_STOP: + case SERVICE_CONTROL_STOP: logerror("Service stopping"); empth_request_shutdown(); - return; + return; - case SERVICE_CONTROL_INTERROGATE: - /* Fall through to send current status. */ - break; + case SERVICE_CONTROL_INTERROGATE: + /* Fall through to send current status. */ + break; - default: - logerror("Unrecognized opcode %ld in ServiceCtrlHandler", - Opcode); + default: + logerror("Unrecognized opcode %ld in ServiceCtrlHandler", + Opcode); } /* Send current status. */ if (!SetServiceStatus (service_status_handle, &service_status)) - logerror("SetServiceStatus error %ld",GetLastError()); + logerror("SetServiceStatus error %ld",GetLastError()); return; } @@ -173,32 +173,32 @@ service_main(DWORD argc, LPTSTR *argv) { int sig; - service_status.dwServiceType = SERVICE_WIN32; - service_status.dwCurrentState = SERVICE_START_PENDING; - service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP; - service_status.dwWin32ExitCode = 0; + service_status.dwServiceType = SERVICE_WIN32; + service_status.dwCurrentState = SERVICE_START_PENDING; + service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP; + service_status.dwWin32ExitCode = 0; service_status.dwServiceSpecificExitCode = 0; - service_status.dwCheckPoint = 0; - service_status.dwWaitHint = 0; + service_status.dwCheckPoint = 0; + service_status.dwWaitHint = 0; service_status_handle = RegisterServiceCtrlHandler( - DEFAULT_SERVICE_NAME, service_ctrl_handler); + DEFAULT_SERVICE_NAME, service_ctrl_handler); if (service_status_handle == (SERVICE_STATUS_HANDLE)0) { - logerror("RegisterServiceCtrlHandler failed %lu\n", GetLastError()); + logerror("RegisterServiceCtrlHandler failed %lu\n", GetLastError()); finish_server(); - return; + return; } start_server(0); /* Initialization complete - report running status. */ - service_status.dwCurrentState = SERVICE_RUNNING; - service_status.dwCheckPoint = 0; - service_status.dwWaitHint = 0; + service_status.dwCurrentState = SERVICE_RUNNING; + service_status.dwCheckPoint = 0; + service_status.dwWaitHint = 0; if (!SetServiceStatus (service_status_handle, &service_status)) { - logerror("SetServiceStatus error %ld\n", GetLastError()); + logerror("SetServiceStatus error %ld\n", GetLastError()); } sig = empth_wait_for_signal(); @@ -215,8 +215,8 @@ stop_service(void) logerror("Service stopped"); service_status.dwWin32ExitCode = 0; service_status.dwCurrentState = SERVICE_STOPPED; - service_status.dwCheckPoint = 0; - service_status.dwWaitHint = 0; + service_status.dwCheckPoint = 0; + service_status.dwWaitHint = 0; if (!SetServiceStatus (service_status_handle, &service_status)) logerror("Error while stopping service SetServiceStatus" diff --git a/src/server/main.c b/src/server/main.c index 8a4756fcd..d13920ba8 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -220,7 +220,7 @@ main(int argc, char **argv) } if (remove_service_set) - return remove_service(service_name); + return remove_service(service_name); if (install_service_set) { program_name = _fullpath(NULL, argv[0], 0); if (config_file != NULL) @@ -452,7 +452,7 @@ shutdwn(int sig) #if defined(_WIN32) if (daemonize) - stop_service(); + stop_service(); #endif exit(0); } -- 2.43.0