Re: [hatari-devel] Seeing Hatari help on Windows? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Seeing Hatari help on Windows?
- From: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Date: Tue, 10 Jun 2025 22:57:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=EoaScbtlyRfSjiafg0ouD7SbiFQEgFfd2E8ciF4w3J8=; h=Content-Type:From:Mime-Version:Subject:Date:Message-Id:To:x-icloud-hme; b=dYfgmMFTfDsjZXgWQE8pBpPok8hC074H86XIfGrEzQRt1wYIvlr5onNB2ISxa0pWQ 1KKJR9sgqt9OqXZQKYu09+IzeETdooqRyE+peWGWqGVAXKU6NaBrmyPX/BgHWTA4wk z+yShoajOKRWPLj1Qr8uJXNmq/Zr1Wq4ICDpign2KE9NkzOYwB89Ko4BwV2NH+r7xv r/3y3pznCdOusQoO6Bq+petTR00buj1e5cj2GwNTlB8Vn9yayIV3yIVh7nZGrCpq+/ i31plDlbvPAlSJT7G5geko1SDsiPe8j7mAYhRPLajudGpSYcxbM7ma6cmripUz3k9S AJfwkcMjjy1Qg==
I tested and can confirm that the current code is broken. Move SDL_Quit() to the end right before exit() to fix it.
> Am 10.06.2025 um 06:51 schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
>
> Hello Eero,
>
>> Am 10.06.2025 um 01:30 schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
>>
>> Hi Andreas,
>>
>> On 7.6.2025 9.25, Andreas Grabher wrote:
>>>>>> Am 07.06.2025 um 08:19 schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
>>>>> In screen.c after "if (!sdlscrn)" SDL_Quit() is called before SDL_GetError(). That clears the error before reporting and SDL_GetError() returns an empty string. I tested this by calling SDL_Quit() after failing to create a renderer (it was easier to force a failure in renderer creation, than in surface creation). I get this message without calling SDL_Quit():
>>>>> ERROR: Failed to create renderer:
>>>>> testrenderer not available
>>>>>
>>>>> And this message with calling SDL_Quit() right before Main_ErrorExit():
>>>>> ERROR: Failed to create renderer:
>>>>>
>>>>> I suggest this fix:
>>>>> Call SDL_Quit() from Main_ErrorExit() right before exit(errval) and remove the call from screen.c. The documentation for SDL_Quit() states: "It is safe to call this function even in the case of errors in initialization.“. So this should always work.
>>>
>>> Thanks for testing! I applied/pushed your suggestion.
>>>
>>> (Another alternative would have been just using a temporary variable for he error message, but SDL_Quit() usage was quite inconsistent, so I think just doing it unconditionally on error exit is better.)
>>
>> Thank you for the patch! But are did you test this? I think the error message from SDL_GetError() is still deleted. SDL_Quit() needs to be called after printing the message (mgs2 in this case).
>>
>> I can test later, but can‘t imagine this is going to work because order is still the same as before (note that msg2 is a pointer).
>>
>>
>>> btw.
>>> Please also fix these messages (you use "initialise" everywhere else, missing semicolon, other error messages start with capital letters):
>>> "logging/tracing initialization failed" -> "Logging/tracing initialisation failed:“
>>> "could not initialize the SDL library:" -> "Could not initialise the SDL library:"
>>
>> I fixed the capitalization, but the semicolon is used only when there's a second (details) message given.
>>
>> And the American spelling is used much more than the British one:
>> $ for i in initialise initialize; do
>> echo "$i: $(git grep $i | wc -l)";
>> done
>> initialise: 17
>> initialize: 94
>>
>> => not going to change that either.
>>
> Thank you for fixing the capitalisation and sorry for my misinderstanding with the semicolon. American vs. British English is a matter of taste. Of course both is correct.
>
> Andreas
>