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

@ -1961,67 +1961,67 @@ void SetAnalyse(
else
return;
CKTcircuit *ckt = NULL;
CKTcircuit *ckt = NULL;
if (ft_curckt)
ckt = ft_curckt->ci_ckt;
if (ft_curckt)
ckt = ft_curckt->ci_ckt;
if ((DecaPercent == OldPercent) && !strcmp(OldAn, Analyse))
return;
if ((DecaPercent == OldPercent) && !strcmp(OldAn, Analyse))
return;
/* get current time */
perf_timer_get_time(&timenow);
diffsec = timenow.seconds;
diffmillisec = timenow.milliseconds;
/* get current time */
perf_timer_get_time(&timenow);
diffsec = timenow.seconds;
diffmillisec = timenow.milliseconds;
s = TMALLOC(char, 128);
s = TMALLOC(char, 128);
if (!strcmp(Analyse, "tran")) {
if (ckt && (ckt->CKTtime > ckt->CKTfinalTime - ckt->CKTmaxStep)) {
sprintf(s, "--ready--");
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)) {
if (!strcmp(Analyse, "tran")) {
if (ckt && (ckt->CKTtime > ckt->CKTfinalTime - ckt->CKTmaxStep)) {
sprintf(s, "--ready--");
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);
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--");
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());
}
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(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) {
sprintf( s, "--ready--");
}
else if (DecaPercent == 0) {
sprintf( s, "%s", Analyse);
}
else if (!strcmp(Analyse, "shooting")) {
sprintf( s, "%s: %d", Analyse, DecaPercent);
}
else {
sprintf( s, "%s: %3.1f%%", Analyse, (double)DecaPercent/10.);
}
else if (DecaPercent == 0) {
sprintf( s, "%s", Analyse);
}
else if (!strcmp(Analyse, "shooting")) {
sprintf( s, "%s: %d", Analyse, DecaPercent);
}
else {
sprintf( s, "%s: %3.1f%%", Analyse, (double)DecaPercent/10.);
}
if (thread1) {
timebefore1.milliseconds = timenow.milliseconds;
timebefore1.seconds = timenow.seconds;
@ -2030,34 +2030,34 @@ void SetAnalyse(
timebefore2.milliseconds = timenow.milliseconds;
timebefore2.seconds = timenow.seconds;
}
/* info when previous analysis period has finished */
if (strcmp(OldAn, Analyse)) {
if ((ft_nginfo || ft_ngdebug) && (strcmp(OldAn, "")))
printf("%s finished after %5.3f seconds.\n", OldAn, seconds());
if(thread1)
strncpy(OldAn1, Analyse, 127);
else
strncpy(OldAn2, Analyse, 127);
}
/* ouput only after a change */
if (strcmp(olds, s))
result = statfcn(s, ng_ident, userptr);
if(thread1)
strcpy(olds1, s);
else
strcpy(olds2, s);
}
tfree(s);
/* info when previous analysis period has finished */
if (strcmp(OldAn, Analyse)) {
if ((ft_nginfo || ft_ngdebug) && (strcmp(OldAn, "")))
printf("%s finished after %5.3f seconds.\n", OldAn, seconds());
if(thread1)
strncpy(OldAn1, Analyse, 127);
else
strncpy(OldAn2, Analyse, 127);
}
/* ouput only after a change */
if (strcmp(olds, s))
result = statfcn(s, ng_ident, userptr);
if(thread1)
strcpy(olds1, s);
else
strcpy(olds2, s);
}
tfree(s);
#else
char* s;
int result;
static bool havesent = FALSE;
if (!havesent) {
s = copy("No usage info available");
result = statfcn(s, ng_ident, userptr);
tfree(s);
havesent = TRUE;
}
char* s;
int result;
static bool havesent = FALSE;
if (!havesent) {
s = copy("No usage info available");
result = statfcn(s, ng_ident, userptr);
tfree(s);
havesent = TRUE;
}
#endif
}

View File

@ -202,7 +202,7 @@ SetSource(char *Name)
tfree(NameW);
#endif
InvalidateRgn(hwSource, NULL, TRUE);
}
}
}
@ -1192,7 +1192,7 @@ wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR
}
#else
{
HDC textDC;
HDC textDC;
TEXTMETRICW tm;
tfont = CreateFontW(15, 0, 0, 0, FW_MEDIUM, FALSE, FALSE,
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;
ReleaseDC(swString, stringDC);
}
}
}
#else
swString = CreateWindowExW(WS_EX_NOPARENTNOTIFY, swClassNameW, swWindowNameW,
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;
ReleaseDC(swString, stringDC);
}
}
}
#endif
/* Element windows */