diff --git a/config/acu.words b/config/acu.words index f029c637a..7779f597c 100644 --- a/config/acu.words +++ b/config/acu.words @@ -427,7 +427,7 @@ reserved: INTERVAL-TIMER # actually a function not supported in GC reserved: JSON reserved: JSON-CODE # note: this is a register, move as soon as supported reserved: JSON-STATUS # note: this is a register, move as soon as supported -reserved: JUST +reserved: JUST=JUSTIFIED reserved: JUSTIFIED reserved: KEPT reserved: KEY diff --git a/libcob/ChangeLog b/libcob/ChangeLog index 5343a932d..141562e58 100644 --- a/libcob/ChangeLog +++ b/libcob/ChangeLog @@ -6,6 +6,8 @@ has proven to be a bit faster than multiplication on pre-calculated mpz * numeric.c (cob_cmp_packed): optimized for speed * intrinsic.c (at_cr_or_db): fixed to do case-insensitive check + * intrinsic.c (cob_intr_hex_to_char): minor speedup by switch to pointer + arithmetic (fixing compiler warning) 2023-01-17 Simon Sobisch diff --git a/libcob/intrinsic.c b/libcob/intrinsic.c index e2958d4d1..228d97473 100644 --- a/libcob/intrinsic.c +++ b/libcob/intrinsic.c @@ -3916,12 +3916,11 @@ cob_intr_hex_to_char (cob_field *srcfield) { cob_field field; const size_t size = srcfield->size / 2; - size_t i, j; - unsigned char *hex_char; + const unsigned char *end = srcfield->data + size * 2; + unsigned char *hex_char, *p; if (size * 2 != srcfield->size) { /* possibly raise nonfatal exception here -> we only process the valid ones */ - // size--; } COB_FIELD_INIT (size, NULL, &const_alpha_attr); @@ -3929,9 +3928,10 @@ cob_intr_hex_to_char (cob_field *srcfield) hex_char = curr_field->data; - for (i = j = 0; j < srcfield->size; ++i) { + p = srcfield->data; + while (p < end) { unsigned char src, dst; - src = (cob_u8_t)srcfield->data[j++]; + src = *p++; if (src >= 'A' && src <= 'F') { dst = src - 'A' + 10; } else if (src >= 'a' && src <= 'f') { @@ -3943,7 +3943,7 @@ cob_intr_hex_to_char (cob_field *srcfield) cob_set_exception (COB_EC_ARGUMENT_FUNCTION); } dst *= 16; - src = (cob_u8_t)srcfield->data[j++]; + src = *p++; if (src >= 'A' && src <= 'F') { dst = dst + src - 'A' + 10; } else if (src >= 'a' && src <= 'f') { diff --git a/libcob/screenio.c b/libcob/screenio.c index 3af209b71..032ef0935 100644 --- a/libcob/screenio.c +++ b/libcob/screenio.c @@ -2070,7 +2070,7 @@ cob_screen_get_all (const int initial_curs, const int accept_timeout) mevent.bstate &= cob_mask_accept; if (mevent.bstate != 0) { global_return = mouse_to_exception_code (mevent.bstate); - cob_move_cursor (mline, mcolumn); // move cursor to pass position + cob_move_cursor (mline, mcolumn); /* move cursor to pass position */ goto screen_return; } continue; @@ -3012,7 +3012,7 @@ field_accept (cob_field *f, const int sline, const int scolumn, cob_field *fgc, mevent.bstate &= cob_mask_accept; if (mevent.bstate != 0) { fret = mouse_to_exception_code (mevent.bstate); - cob_move_cursor (mline, mcolumn); // move cursor to pass position + cob_move_cursor (mline, mcolumn); /* move cursor to pass position */ goto field_return; } } @@ -3254,7 +3254,7 @@ field_accept (cob_field *f, const int sline, const int scolumn, cob_field *fgc, mevent.bstate &= cob_mask_accept; if (mevent.bstate != 0) { fret = mouse_to_exception_code (mevent.bstate); - cob_move_cursor (mline, mcolumn); // move cursor to pass position + cob_move_cursor (mline, mcolumn); /* move cursor to pass position */ goto field_return; } continue;