mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 18:03:03 +01:00
Misc cleanup.
This commit is contained in:
parent
0535156358
commit
e5ad0f1a7f
@ -1481,7 +1481,7 @@ SSHORT API_ROUTINE gds__msg_lookup(void* handle,
|
||||
|
||||
const ULONG code = MSG_NUMBER(facility, number);
|
||||
const msgnod* const end =
|
||||
(MSGNOD) ((SCHAR *) messageL->msg_bucket + messageL->msg_bucket_size);
|
||||
(msgnod*) ((char*) messageL->msg_bucket + messageL->msg_bucket_size);
|
||||
ULONG position = messageL->msg_top_tree;
|
||||
|
||||
status = 0;
|
||||
@ -1494,7 +1494,7 @@ SSHORT API_ROUTINE gds__msg_lookup(void* handle,
|
||||
else if (n == messageL->msg_levels)
|
||||
break;
|
||||
else {
|
||||
for (const msgnod* node = (MSGNOD) messageL->msg_bucket; !status; node++) {
|
||||
for (const msgnod* node = (msgnod*) messageL->msg_bucket; !status; node++) {
|
||||
if (node >= end) {
|
||||
status = -8;
|
||||
break;
|
||||
@ -1509,10 +1509,10 @@ SSHORT API_ROUTINE gds__msg_lookup(void* handle,
|
||||
|
||||
if (!status) {
|
||||
/* Search the leaf */
|
||||
for (const msgrec* leaf = (MSGREC) messageL->msg_bucket; !status;
|
||||
for (const msgrec* leaf = (msgrec*) messageL->msg_bucket; !status;
|
||||
leaf = NEXT_LEAF(leaf))
|
||||
{
|
||||
if (leaf >= (MSGREC) end || leaf->msgrec_code > code) {
|
||||
if (leaf >= (const msgrec*) end || leaf->msgrec_code > code) {
|
||||
status = -1;
|
||||
break;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
* Contributor(s): ______________________________________.
|
||||
*/
|
||||
/*
|
||||
$Id: msg.h,v 1.6 2004-05-24 17:28:33 brodsom Exp $
|
||||
$Id: msg.h,v 1.7 2004-10-04 04:59:43 robocop Exp $
|
||||
*/
|
||||
|
||||
#ifndef JRD_MSG_H
|
||||
@ -52,8 +52,6 @@ struct msgnod {
|
||||
ULONG msgnod_seek; /* Offset of next bucket or message */
|
||||
};
|
||||
|
||||
typedef msgnod *MSGNOD;
|
||||
|
||||
/* Leaf node */
|
||||
|
||||
struct msgrec {
|
||||
@ -64,7 +62,6 @@ struct msgrec {
|
||||
};
|
||||
|
||||
typedef msgrec *MSGREC;
|
||||
|
||||
#define NEXT_LEAF(leaf) (MSGREC) \
|
||||
((SCHAR*) leaf + FB_ALIGN(OFFSETA (MSGREC, msgrec_text) + leaf->msgrec_length, sizeof (SLONG)))
|
||||
|
||||
|
@ -166,7 +166,7 @@ int CLIB_ROUTINE main( int argc, char** argv)
|
||||
/* make sure the path name ends in a '/' */
|
||||
|
||||
if (pathname) {
|
||||
size_t len = strlen(pathname);
|
||||
const size_t len = strlen(pathname);
|
||||
//fb_assert(len + 1 < MAXPATHLEN);
|
||||
if (pathname[len - 1] != path_separator) {
|
||||
pathname[len] = path_separator;
|
||||
@ -281,7 +281,7 @@ static USHORT do_msgs( const TEXT* filename, const TEXT* locale, bool sw_warning
|
||||
|
||||
// Divy up memory among various buffers
|
||||
// Memory leaking until the program finishes?
|
||||
msgrec* leaf_node = (MSGREC) gds__alloc((SLONG) MSG_BUCKET);
|
||||
msgrec* leaf_node = (msgrec*) gds__alloc((SLONG) MSG_BUCKET);
|
||||
msgrec* const leaf = leaf_node;
|
||||
const TEXT* const end_leaf = (TEXT*) leaf + MSG_BUCKET;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user