De *.C Para *.Obj en BCC74 no funciona más.

User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by Antonio Linares »

Dear Enrico,

great!

going to test it... :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Eroni
Posts: 100
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by Eroni »

Dear
Any ideas on how I could resolve this error?

Code: Select all | Expand

static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ) {

    uint16_t crc;
    uint16_t tmp;
    uint16_t short_c;
    const unsigned char *ptr;
    size_t a;

    if ( ! crc_tabccitt_init ) init_crcccitt_tab();

    crc = start_value;
    ptr = input_str;

    if ( ptr != NULL ) for (a=0; a<num_bytes; a++) {

        short_c = 0x00ff & (unsigned short) *ptr;     // Conversion may lose significant digits in function crc_ccitt_generic
        tmp     = (crc >> 8) ^ short_c;               // Conversion may lose significant digits in function crc_ccitt_generic
        crc     = (crc << 8) ^ crc_tabccitt[tmp];     // Conversion may lose significant digits in function crc_ccitt_generic

        ptr++;
    }

    return crc;
 
Thanks in advance
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by Enrico Maria Giordano »

Eroni wrote:Dear
Any ideas on how I could resolve this error?

Code: Select all | Expand

static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ) {

    uint16_t crc;
    uint16_t tmp;
    uint16_t short_c;
    const unsigned char *ptr;
    size_t a;

    if ( ! crc_tabccitt_init ) init_crcccitt_tab();

    crc = start_value;
    ptr = input_str;

    if ( ptr != NULL ) for (a=0; a<num_bytes; a++) {

        short_c = 0x00ff & (unsigned short) *ptr;     // Conversion may lose significant digits in function crc_ccitt_generic
        tmp     = (crc >> 8) ^ short_c;               // Conversion may lose significant digits in function crc_ccitt_generic
        crc     = (crc << 8) ^ crc_tabccitt[tmp];     // Conversion may lose significant digits in function crc_ccitt_generic

        ptr++;
    }

    return crc;
 
Thanks in advance
Try this and let me know if it works for you:

Code: Select all | Expand

short_c = ( uint16_t ) ( 0x00ff & (unsigned short) *ptr );
tmp     = ( uint16_t ) ( (crc >> 8) ^ short_c );
crc     = ( uint16_t ) ( (crc << 8) ^ crc_tabccitt[tmp] );
paquitohm
Posts: 284
Joined: Fri Jan 14, 2022 8:37 am

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by paquitohm »

Enrico Maria Giordano wrote:32-bit version: https://github.com/FiveTechSoft/harbour ... 230707.zip

Mr. Enrico,

Thank you very much for your efforts.

Three items.
- Is stable release ?
- a few old 7/7/23 perhaps ?
- What it provides, it is faster, more compatible ?
Regards
User avatar
Eroni
Posts: 100
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by Eroni »

Enrico Maria Giordano wrote:
Eroni wrote:Dear
Any ideas on how I could resolve this error?

Code: Select all | Expand

static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ) {

    uint16_t crc;
    uint16_t tmp;
    uint16_t short_c;
    const unsigned char *ptr;
    size_t a;

    if ( ! crc_tabccitt_init ) init_crcccitt_tab();

    crc = start_value;
    ptr = input_str;

    if ( ptr != NULL ) for (a=0; a<num_bytes; a++) {

        short_c = 0x00ff & (unsigned short) *ptr;     // Conversion may lose significant digits in function crc_ccitt_generic
        tmp     = (crc >> 8) ^ short_c;               // Conversion may lose significant digits in function crc_ccitt_generic
        crc     = (crc << 8) ^ crc_tabccitt[tmp];     // Conversion may lose significant digits in function crc_ccitt_generic

        ptr++;
    }

    return crc;
 
Thanks in advance
Try this and let me know if it works for you:

Code: Select all | Expand

short_c = ( uint16_t ) ( 0x00ff & (unsigned short) *ptr );
tmp     = ( uint16_t ) ( (crc >> 8) ^ short_c );
crc     = ( uint16_t ) ( (crc << 8) ^ crc_tabccitt[tmp] );

Mr Enrico, works!
Thank you so much!
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by Enrico Maria Giordano »

paquitohm wrote:
Enrico Maria Giordano wrote:32-bit version: https://github.com/FiveTechSoft/harbour ... 230707.zip

Mr. Enrico,

Thank you very much for your efforts.

Three items.
- Is stable release ?
- a few old 7/7/23 perhaps ?
- What it provides, it is faster, more compatible ?
Regards
Yes, it is stable. Date is 28 october 2023. I don't think it is faster than 7.60 but it is worth to use it as it is an updated version.
paquitohm
Posts: 284
Joined: Fri Jan 14, 2022 8:37 am

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by paquitohm »

In other words.
Actually I am using bcc73.
Are there big differences than bcc76 ?

Thanks in advance
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by karinha »

Enrico Maria Giordano wrote:No, you can use it without problems. I recommend the new BCC 7.70:

http://xharbour.org/index.asp?page=down ... quired_win
Gran noticias Maestro Enrico. ¡Lo probaré ahora!

Great news master Enrico. I'll test it now!

Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by karinha »

Funciona perfecto!

C:\BCC77
C:\XHBBCC77

https://imgur.com/4UcCRHC

Image

Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: De *.C Para *.Obj en BCC74 no funciona más.

Post by karinha »

Enrico Maria Giordano wrote:Great! Can you test curl, if you are familiar with it, please?
Never used. Do you have a model and the names of the .LIBs that I should use?

Nunca usé. ¿Tiene un modelo y los nombres de los .LIB que debo usar?

Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Post Reply