• 2023-12-19 19:12 UTC+0100 Enrico Maria Giordano

    From Enrico Maria Giordano@21:1/5 to All on Tue Dec 19 19:13:47 2023
    2023-12-19 19:12 UTC+0100 Enrico Maria Giordano
    <e.m.giordano@emagsoftware.it>
    * contrib\hbhpdf
    ! Reverted my recent changes

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Tue Dec 19 19:59:17 2023
    Il 19/12/2023 19:13, Enrico Maria Giordano ha scritto:

    2023-12-19 19:12 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
      * contrib\hbhpdf
        ! Reverted my recent changes

    OK, now I get many of these errors using MSC32:

    contrib\hbhpdf\hpdf_objects.c(60): error C2664: 'void HPDF_String_Free(HPDF_String)': cannot convert argument 1 from 'void *'
    to 'HPDF_String'
    contrib\hbhpdf\hpdf_objects.c(60): note: Conversion from 'void*' to
    pointer to non-'void' requires an explicit cast

    Please note that they are errors, not warnings. What to do, other than
    fixing them?

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ron Pinkas@21:1/5 to Enrico Maria Giordano on Tue Dec 19 14:26:06 2023
    Enrico Maria Giordano wrote:


    Il 19/12/2023 19:13, Enrico Maria Giordano ha scritto:

    2023-12-19 19:12 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
      * contrib\hbhpdf
        ! Reverted my recent changes

    OK, now I get many of these errors using MSC32:

    contrib\hbhpdf\hpdf_objects.c(60): error C2664: 'void HPDF_String_Free(HPDF_String)': cannot convert argument 1 from 'void *'
    to 'HPDF_String'
    contrib\hbhpdf\hpdf_objects.c(60): note: Conversion from 'void*' to
    pointer to non-'void' requires an explicit cast

    Please note that they are errors, not warnings. What to do, other than
    fixing them?


    Thanks, I will review and get back o you.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ron Pinkas@21:1/5 to Enrico Maria Giordano on Tue Dec 19 15:34:31 2023
    Enrico Maria Giordano wrote:


    Il 19/12/2023 19:13, Enrico Maria Giordano ha scritto:

    2023-12-19 19:12 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
      * contrib\hbhpdf
        ! Reverted my recent changes

    OK, now I get many of these errors using MSC32:

    contrib\hbhpdf\hpdf_objects.c(60): error C2664: 'void HPDF_String_Free(HPDF_String)': cannot convert argument 1 from 'void *'
    to 'HPDF_String'
    contrib\hbhpdf\hpdf_objects.c(60): note: Conversion from 'void*' to
    pointer to non-'void' requires an explicit cast

    Please note that they are errors, not warnings. What to do, other than
    fixing them?


    Enbrico,

    Can you please provide all of them?

    One approahc we may consider is:

    -D'HPDF_String_Free(arg)=HPDF_String_Free((HPDF_String)(arg))'

    On the command line in the make for given compiler.

    Another approach is to FORK libharu and make the fixes in our fork, and
    later we may MERGE future modifications of libharu into our fork.

    Or BEST we may open an issue on GitHub, and report such errors and
    propose the fix ass a PULL REQUEST.

    What do you think?

    Ron


    Ron

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ron Pinkas@21:1/5 to Ron Pinkas on Tue Dec 19 16:23:51 2023
    Ron Pinkas wrote:
    Enrico Maria Giordano wrote:


    Il 19/12/2023 19:13, Enrico Maria Giordano ha scritto:

    2023-12-19 19:12 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
      * contrib\hbhpdf
        ! Reverted my recent changes

    OK, now I get many of these errors using MSC32:

    contrib\hbhpdf\hpdf_objects.c(60): error C2664: 'void HPDF_String_Free(HPDF_String)': cannot convert argument 1 from 'void *'
    to 'HPDF_String'
    contrib\hbhpdf\hpdf_objects.c(60): note: Conversion from 'void*' to
    pointer to non-'void' requires an explicit cast

    Please note that they are errors, not warnings. What to do, other than fixing them?


    Enbrico,

    Can you please provide all of them?

    One approahc we may consider is:

    -D'HPDF_String_Free(arg)=HPDF_String_Free((HPDF_String)(arg))'

    On the command line in the make for given compiler.

    Another approach is to FORK libharu and make the fixes in our fork, and
    later we may MERGE future modifications of libharu into our fork.

    Or BEST we may open an issue on GitHub, and report such errors and
    propose the fix ass a PULL REQUEST.

    What do you think?

    Ron


    Ron

    One more approach is to ADD one more source file (xhb_config.c) like
    this:

    ------ xhb_config.c ------
    #ifdef __cplusplus
    extern "C" {
    #endif

    // Original function declaration (if not already declared)
    void HPDF_String_Free(HPDF_String arg);

    #ifdef __cplusplus
    }

    // Overloaded function for C++
    void HPDF_String_Free(void* arg) {
    HPDF_String_Free(static_cast<HPDF_String>(arg));
    }

    #endif
    ------ EOF xhb_config.c ------

    AND one header (xhb_config.h) like this:

    ----- xhb_config.h -----
    #ifndef XHB_CONFIG_H
    #define XHB_CONFIG_H

    #ifdef __cplusplus
    extern "C" {
    #endif

    // Direct declaration of the original HPDF_String_Free function
    // Replace the return type and parameters as per the actual function signature void HPDF_String_Free(HPDF_String arg);

    #ifdef __cplusplus
    }

    // C++ overload for HPDF_String_Free
    void HPDF_String_Free(void* arg) {
    HPDF_String_Free(static_cast<HPDF_String>(arg));
    }

    #endif // __cplusplus

    #endif // XHB_CONFIG_H
    ----- EOF xhb_config.h -----

    Then we add xhb_config.c to make files of C++ compilers like MSC and we
    also add automatic inclusion of xhb_config.h
    (for MSC add flag: /FI"xhb_config.h")

    This approach uses C++ funcion overloading to automaically directs calls
    with void * to overloaded wrapper which then add the cast and call the
    real function (NO R/TT overhead).

    Do you know which make file is used for MSVC - this approach can quickly
    be impllemented and is a safe approach.

    Ron

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Tue Dec 19 23:39:34 2023
    Il 19/12/2023 21:34, Ron Pinkas ha scritto:

    Can you please provide all of them?

    Already provided in my previous message.

    One approahc we may consider is:

    -D'HPDF_String_Free(arg)=HPDF_String_Free((HPDF_String)(arg))'

    On the command line in the make for given compiler.

    Another approach is to FORK libharu and make the fixes in our fork, and
    later we may MERGE future modifications of libharu into our fork.

    Or BEST we may open an issue on GitHub, and report such errors and
    propose the fix ass a PULL REQUEST.

    What do you think?

    Too much work. I think we can suppress the warnings and solve the few
    errors defining modff() somehow.

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Tue Dec 19 23:44:01 2023
    Il 19/12/2023 22:23, Ron Pinkas ha scritto:

    One more approach is to ADD one more source file (xhb_config.c) like
    this:

    I vote no. Too much complicated.

    --
    Enrico Maria Giordano

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)