Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bah.Serial.mod Problems with BlitzMax NG #102

Open
MidimasterSoft opened this issue Sep 25, 2023 · 3 comments
Open

Bah.Serial.mod Problems with BlitzMax NG #102

MidimasterSoft opened this issue Sep 25, 2023 · 3 comments

Comments

@MidimasterSoft
Copy link

On Syntaxbomb a user reports heavy problems with the combination of current version of BlitzMax NG ( BlitzMax_win32_x64_mingw_0.136.3.51 ) with Bah.Serial.mod.

A test on 2 years old BlitzMax NG (BBC 0.129 BMK 3.45 Win32-x64 GCC 8.1.0) gave no such messages.

Here is a thread in syntaxbomb with detailed informations and discussion:
https://www.syntaxbomb.com/blitz2d-blitzplus-blitz3d/serial-io-com-ports/

Compiler Log:

[ 16%] Compiling:glue.cpp
[ 16%] Compiling:list_win32.cpp
[ 80%] Compiling:regex.bmx.debug.win32.x86.c
[ 80%] Compiling:regex.bmx.debug.win32.x86.c
D:/BlitzMax/mod/Bah.mod/serial.mod/list_win32.cpp: In function 'void bmx_serial_listports(BBObject*)':
D:/BlitzMax/mod/Bah.mod/serial.mod/list_win32.cpp:86:80: error: invalid conversion from 'char*' to 'const unsigned char*' [-fpermissive]
  86 |                                        bbProductName = bbStringFromUTF8String((char*)buffer);
      |                                                                                ^~~~~~~~~~~~~
      |                                                                                |
      |                                                                                char*
In file included from D:/BlitzMax/mod/brl.mod/blitz.mod/blitz.h:37,
                from D:/BlitzMax/mod/Bah.mod/serial.mod/list_win32.cpp:41:
D:/BlitzMax/mod/brl.mod/blitz.mod/blitz_string.h:129:55: note:  initializing argument 1 of 'BBString* bbStringFromUTF8String(const unsigned char*)'
  129 | BBString*bbStringFromUTF8String( const unsigned char *p );
      |                                  ~~~~~~~~~~~~~~~~~~~~~^
D:/BlitzMax/mod/Bah.mod/serial.mod/list_win32.cpp:94:81: error: invalid conversion from 'char*' to 'const unsigned char*' [-fpermissive]
  94 |                                        bbPhysicalName = bbStringFromUTF8String((char*)buffer);
.... and man more lines like this... ```
@GWRon
Copy link
Contributor

GWRon commented Sep 25, 2023

As I've written there (at syntaxbomb) the solution is to update the cast as 2 yrs ago the bbStringFromUTF8String-function was adjusted.

bbProductName = bbStringFromUTF8String((char*)buffer);
-> bbProductName = bbStringFromUTF8String((unsigned char*)buffer);

bbPhysicalName = bbStringFromUTF8String((char*)buffer);
-> bbPhysicalName = bbStringFromUTF8String((unsigned char*)buffer);

...

@woollybah
Copy link
Member

See here : https://github.com/bmx-ng/io.mod

@woollybah
Copy link
Member

We'll archive this module soon, I expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants