![]() This is definitely the proper way to implement my window message passing system, and as such I have rewritten the relevent parts of libui and bsnes/lui to use uintptr_t. This is a variable declared in stdint.h that states it is safe to cast a pointer to an integer, and then that integer back to a pointer. Lastly, I came up with a proper fix for casting between integers and pointers: uintptr_t. Next, during the rewrite, I never added back command-line loading. In my case, I had to replace 0 with (const gchar*)0. ![]() The solution is to cast vararg null pointers explicitly. It's non-obvious, as non-vararg functions will promote int(0) to 64-bits automatically. Quite a serious issue, I can see many people running into this problem. So whenever the stack happened to contain a non-zero upper half, GTK+ would think the pointer was valid, and attempt to read from it. So, I was pushing half of the pointer, but the upper half was basically not set. But on Linux/amd64, an int is 32-bits, whereas a pointer is 64-bits. This is no problem on 32-bit architectures as an integer and pointer are the same length. Well, null is defined as 0 in c++ (and (void*)0 in c). However, if you don't need this parameter (and I don't), you can pass it a null pointer. The very last parameter passed is pointer to a string. ![]() It appears that gtk_file_chooser_dialog_new() is a vararg function. Luckily, I came across the fix in a kino changelog. The cause of this error was quite fun to track down. First, it appears bsnes was crashing on Linux/amd64 platforms when selecting 'File->Load Cartridge'. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |