45 |
|
SDError |
46 |
|
SDreportEnglish(SDError ec, FILE *fp) |
47 |
|
{ |
48 |
– |
if (fp == NULL) |
49 |
– |
return ec; |
48 |
|
if (!ec) |
49 |
|
return SDEnone; |
50 |
+ |
if ((ec < SDEnone) | (ec > SDEunknown)) { |
51 |
+ |
SDerrorDetail[0] = '\0'; |
52 |
+ |
ec = SDEunknown; |
53 |
+ |
} |
54 |
+ |
if (fp == NULL) |
55 |
+ |
return ec; |
56 |
|
fputs(SDerrorEnglish[ec], fp); |
57 |
|
if (SDerrorDetail[0]) { |
58 |
|
fputs(": ", fp); |
338 |
|
sdl->next = SDcacheList; |
339 |
|
SDcacheList = sdl; |
340 |
|
|
341 |
< |
sdl->refcnt++; |
341 |
> |
sdl->refcnt = 1; |
342 |
|
return &sdl->bsdf; |
343 |
|
} |
344 |
|
|
382 |
|
for (sdl = SDcacheList; sdl != NULL; sdl = (sdLast=sdl)->next) |
383 |
|
if (&sdl->bsdf == sd) |
384 |
|
break; |
385 |
< |
if (sdl == NULL || --sdl->refcnt) |
385 |
> |
if (sdl == NULL || (sdl->refcnt -= (sdl->refcnt > 0))) |
386 |
|
return; /* missing or still in use */ |
387 |
|
/* keep unreferenced data? */ |
388 |
|
if (SDisLoaded(sd) && SDretainSet) { |