format - white spaces

This commit is contained in:
dwarning 2024-11-06 15:02:10 +01:00 committed by Holger Vogt
parent bf6ffd357d
commit 3d20dc0da7
4 changed files with 89 additions and 89 deletions

View File

@ -261,7 +261,7 @@ printres(char *name)
// fprintf(cp_out, "Resident set size = "); // fprintf(cp_out, "Resident set size = ");
// fprintmem(cp_out, mem_ng_act.resident); // fprintmem(cp_out, mem_ng_act.resident);
// fprintf(cp_out, ".\n"); // fprintf(cp_out, ".\n");
fprintf(cp_out, "\n"); fprintf(cp_out, "\n");
fprintf(cp_out, "Shared ngspice pages = "); fprintf(cp_out, "Shared ngspice pages = ");
fprintmem(cp_out, mem_ng_act.shared); fprintmem(cp_out, mem_ng_act.shared);
fprintf(cp_out, ".\n"); fprintf(cp_out, ".\n");

View File

@ -23,7 +23,7 @@ Copyright 1990 Regents of the University of California. All rights reserved.
#include <windows.h> #include <windows.h>
#ifndef HAVE_GETTIMEOFDAY #ifndef HAVE_GETTIMEOFDAY
#include <winsock2.h> #include <winsock2.h>
#include <stdint.h> // portable: uint64_t MSVC: __int64 #include <stdint.h> // portable: uint64_t MSVC: __int64
/*/ MSVC defines this in winsock2.h!? /*/ MSVC defines this in winsock2.h!?
typedef struct timeval { typedef struct timeval {
@ -36,7 +36,7 @@ int gettimeofday(struct timeval * tp, void * unused)
NG_IGNORE(unused); NG_IGNORE(unused);
// Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's // Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's
// This magic number is the number of 100 nanosecond intervals since January 1, 1601 (UTC) // This magic number is the number of 100 nanosecond intervals since January 1, 1601 (UTC)
// until 00:00:00 January 1, 1970 // until 00:00:00 January 1, 1970
static const uint64_t EPOCH = ((uint64_t) 116444736000000000ULL); static const uint64_t EPOCH = ((uint64_t) 116444736000000000ULL);
SYSTEMTIME system_time; SYSTEMTIME system_time;
@ -108,9 +108,9 @@ void timediff(PerfTime *now, PerfTime *begin, int *sec, int *msec)
} }
/* /*
* How many seconds have elapsed in running time. * How many seconds have elapsed in running time.
* This is the routine called in IFseconds * This is the routine called in IFseconds
*/ */
double double

View File

@ -976,7 +976,7 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi
#else /* ~ HAVE_PWD_H */ #else /* ~ HAVE_PWD_H */
/* load user's initialisation file /* load user's initialisation file
try accessing the initialisation file .spiceinit in a user provided try accessing the initialisation file .spiceinit in a user provided
path read from environmental variable SPICE_USERINIT_DIR, path read from environmental variable SPICE_USERINIT_DIR,
if that fails try the alternate name spice.rc, then look into if that fails try the alternate name spice.rc, then look into
the current directory, then the HOME directory, then into USERPROFILE. the current directory, then the HOME directory, then into USERPROFILE.
Don't read .spiceinit, if ngSpice_nospiceinit() has been called. */ Don't read .spiceinit, if ngSpice_nospiceinit() has been called. */
@ -1913,7 +1913,7 @@ void SetAnalyse(
|| defined (HAVE_FTIME) || defined (HAVE_FTIME)
PerfTime timenow; /* actual time stamp */ PerfTime timenow; /* actual time stamp */
int diffsec, diffmillisec; /* differences actual minus prev. time stamp */ int diffsec, diffmillisec; /* differences actual minus prev. time stamp */
int result; /* return value from callback function */ int result; /* return value from callback function */
char* s; /* outputs to callback function */ char* s; /* outputs to callback function */
int OldPercent; /* Previous progress value */ int OldPercent; /* Previous progress value */
char OldAn[128]; /* Previous analysis type */ char OldAn[128]; /* Previous analysis type */
@ -1961,67 +1961,67 @@ void SetAnalyse(
else else
return; return;
CKTcircuit *ckt = NULL; CKTcircuit *ckt = NULL;
if (ft_curckt) if (ft_curckt)
ckt = ft_curckt->ci_ckt; ckt = ft_curckt->ci_ckt;
if ((DecaPercent == OldPercent) && !strcmp(OldAn, Analyse)) if ((DecaPercent == OldPercent) && !strcmp(OldAn, Analyse))
return; return;
/* get current time */ /* get current time */
perf_timer_get_time(&timenow); perf_timer_get_time(&timenow);
diffsec = timenow.seconds; diffsec = timenow.seconds;
diffmillisec = timenow.milliseconds; diffmillisec = timenow.milliseconds;
s = TMALLOC(char, 128); s = TMALLOC(char, 128);
if (!strcmp(Analyse, "tran")) { if (!strcmp(Analyse, "tran")) {
if (ckt && (ckt->CKTtime > ckt->CKTfinalTime - ckt->CKTmaxStep)) { if (ckt && (ckt->CKTtime > ckt->CKTfinalTime - ckt->CKTmaxStep)) {
sprintf(s, "--ready--"); sprintf(s, "--ready--");
result = statfcn(s, ng_ident, userptr); result = statfcn(s, ng_ident, userptr);
tfree(s);
return;
}
}
if (DecaPercent >= 1000){
/* Because CKTmaxStep may be smaller than 0.1%, we print only when CKTtime is large enough. */
if (!strcmp(Analyse, "tran") && ckt && (ckt->CKTtime < ckt->CKTfinalTime - ckt->CKTmaxStep)) {
tfree(s); tfree(s);
return; return;
}
}
if (DecaPercent >= 1000){
/* Because CKTmaxStep may be smaller than 0.1%, we print only when CKTtime is large enough. */
if (!strcmp(Analyse, "tran") && ckt && (ckt->CKTtime < ckt->CKTfinalTime - ckt->CKTmaxStep)) {
tfree(s);
return;
}
sprintf( s, "--ready--");
result = statfcn(s, ng_ident, userptr);
tfree(s);
return;
}
/* info every one percent of progress:
actual time, progress,
to catch linearity of progress of simulation */
if (ft_ngdebug && !strcmp(Analyse, "tran"))
if ((int)((double)DecaPercent/10.) > (int)((double)OldPercent/10.)) {
printf("%3.1f%% percent progress after %4.2f seconds.\n", (double)DecaPercent/10., seconds());
} }
sprintf( s, "--ready--"); if(thread1)
result = statfcn(s, ng_ident, userptr); OldPercent1 = DecaPercent;
tfree(s); else
return; OldPercent2 = DecaPercent;
} /* output only into hwAnalyse window and if time elapsed is larger than
/* info every one percent of progress: DELTATIME given value, or if analysis has changed, else return */
actual time, progress, if ((diffsec > 0) || (diffmillisec > DELTATIME) || strcmp(OldAn, Analyse)) {
to catch linearity of progress of simulation */
if (ft_ngdebug && !strcmp(Analyse, "tran"))
if ((int)((double)DecaPercent/10.) > (int)((double)OldPercent/10.)) {
printf("%3.1f%% percent progress after %4.2f seconds.\n", (double)DecaPercent/10., seconds());
}
if(thread1)
OldPercent1 = DecaPercent;
else
OldPercent2 = DecaPercent;
/* output only into hwAnalyse window and if time elapsed is larger than
DELTATIME given value, or if analysis has changed, else return */
if ((diffsec > 0) || (diffmillisec > DELTATIME) || strcmp(OldAn, Analyse)) {
if (DecaPercent < 0) { if (DecaPercent < 0) {
sprintf( s, "--ready--"); sprintf( s, "--ready--");
} }
else if (DecaPercent == 0) { else if (DecaPercent == 0) {
sprintf( s, "%s", Analyse); sprintf( s, "%s", Analyse);
} }
else if (!strcmp(Analyse, "shooting")) { else if (!strcmp(Analyse, "shooting")) {
sprintf( s, "%s: %d", Analyse, DecaPercent); sprintf( s, "%s: %d", Analyse, DecaPercent);
} }
else { else {
sprintf( s, "%s: %3.1f%%", Analyse, (double)DecaPercent/10.); sprintf( s, "%s: %3.1f%%", Analyse, (double)DecaPercent/10.);
} }
if (thread1) { if (thread1) {
timebefore1.milliseconds = timenow.milliseconds; timebefore1.milliseconds = timenow.milliseconds;
timebefore1.seconds = timenow.seconds; timebefore1.seconds = timenow.seconds;
@ -2030,34 +2030,34 @@ void SetAnalyse(
timebefore2.milliseconds = timenow.milliseconds; timebefore2.milliseconds = timenow.milliseconds;
timebefore2.seconds = timenow.seconds; timebefore2.seconds = timenow.seconds;
} }
/* info when previous analysis period has finished */ /* info when previous analysis period has finished */
if (strcmp(OldAn, Analyse)) { if (strcmp(OldAn, Analyse)) {
if ((ft_nginfo || ft_ngdebug) && (strcmp(OldAn, ""))) if ((ft_nginfo || ft_ngdebug) && (strcmp(OldAn, "")))
printf("%s finished after %5.3f seconds.\n", OldAn, seconds()); printf("%s finished after %5.3f seconds.\n", OldAn, seconds());
if(thread1) if(thread1)
strncpy(OldAn1, Analyse, 127); strncpy(OldAn1, Analyse, 127);
else else
strncpy(OldAn2, Analyse, 127); strncpy(OldAn2, Analyse, 127);
} }
/* ouput only after a change */ /* ouput only after a change */
if (strcmp(olds, s)) if (strcmp(olds, s))
result = statfcn(s, ng_ident, userptr); result = statfcn(s, ng_ident, userptr);
if(thread1) if(thread1)
strcpy(olds1, s); strcpy(olds1, s);
else else
strcpy(olds2, s); strcpy(olds2, s);
} }
tfree(s); tfree(s);
#else #else
char* s; char* s;
int result; int result;
static bool havesent = FALSE; static bool havesent = FALSE;
if (!havesent) { if (!havesent) {
s = copy("No usage info available"); s = copy("No usage info available");
result = statfcn(s, ng_ident, userptr); result = statfcn(s, ng_ident, userptr);
tfree(s); tfree(s);
havesent = TRUE; havesent = TRUE;
} }
#endif #endif
} }

View File

@ -202,7 +202,7 @@ SetSource(char *Name)
tfree(NameW); tfree(NameW);
#endif #endif
InvalidateRgn(hwSource, NULL, TRUE); InvalidateRgn(hwSource, NULL, TRUE);
} }
} }
@ -1192,7 +1192,7 @@ wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR
} }
#else #else
{ {
HDC textDC; HDC textDC;
TEXTMETRICW tm; TEXTMETRICW tm;
tfont = CreateFontW(15, 0, 0, 0, FW_MEDIUM, FALSE, FALSE, tfont = CreateFontW(15, 0, 0, 0, FW_MEDIUM, FALSE, FALSE,
FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
@ -1240,7 +1240,7 @@ wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR
LineHeight = tm.tmHeight + tm.tmExternalLeading + BorderSize; LineHeight = tm.tmHeight + tm.tmExternalLeading + BorderSize;
ReleaseDC(swString, stringDC); ReleaseDC(swString, stringDC);
} }
} }
#else #else
swString = CreateWindowExW(WS_EX_NOPARENTNOTIFY, swClassNameW, swWindowNameW, swString = CreateWindowExW(WS_EX_NOPARENTNOTIFY, swClassNameW, swWindowNameW,
ES_LEFT | WS_CHILD | WS_BORDER | ES_LEFT | WS_CHILD | WS_BORDER |
@ -1258,7 +1258,7 @@ wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR
LineHeight = tm.tmHeight + tm.tmExternalLeading + BorderSize; LineHeight = tm.tmHeight + tm.tmExternalLeading + BorderSize;
ReleaseDC(swString, stringDC); ReleaseDC(swString, stringDC);
} }
} }
#endif #endif
/* Element windows */ /* Element windows */