8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 23:23:02 +01:00

Misc cleanup.

This commit is contained in:
robocop 2004-10-04 04:59:43 +00:00
parent 0535156358
commit e5ad0f1a7f
3 changed files with 7 additions and 10 deletions

View File

@ -1481,7 +1481,7 @@ SSHORT API_ROUTINE gds__msg_lookup(void* handle,
const ULONG code = MSG_NUMBER(facility, number); const ULONG code = MSG_NUMBER(facility, number);
const msgnod* const end = 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; ULONG position = messageL->msg_top_tree;
status = 0; status = 0;
@ -1494,7 +1494,7 @@ SSHORT API_ROUTINE gds__msg_lookup(void* handle,
else if (n == messageL->msg_levels) else if (n == messageL->msg_levels)
break; break;
else { else {
for (const msgnod* node = (MSGNOD) messageL->msg_bucket; !status; node++) { for (const msgnod* node = (msgnod*) messageL->msg_bucket; !status; node++) {
if (node >= end) { if (node >= end) {
status = -8; status = -8;
break; break;
@ -1509,10 +1509,10 @@ SSHORT API_ROUTINE gds__msg_lookup(void* handle,
if (!status) { if (!status) {
/* Search the leaf */ /* 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)) leaf = NEXT_LEAF(leaf))
{ {
if (leaf >= (MSGREC) end || leaf->msgrec_code > code) { if (leaf >= (const msgrec*) end || leaf->msgrec_code > code) {
status = -1; status = -1;
break; break;
} }

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________. * 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 #ifndef JRD_MSG_H
@ -52,8 +52,6 @@ struct msgnod {
ULONG msgnod_seek; /* Offset of next bucket or message */ ULONG msgnod_seek; /* Offset of next bucket or message */
}; };
typedef msgnod *MSGNOD;
/* Leaf node */ /* Leaf node */
struct msgrec { struct msgrec {
@ -64,7 +62,6 @@ struct msgrec {
}; };
typedef msgrec *MSGREC; typedef msgrec *MSGREC;
#define NEXT_LEAF(leaf) (MSGREC) \ #define NEXT_LEAF(leaf) (MSGREC) \
((SCHAR*) leaf + FB_ALIGN(OFFSETA (MSGREC, msgrec_text) + leaf->msgrec_length, sizeof (SLONG))) ((SCHAR*) leaf + FB_ALIGN(OFFSETA (MSGREC, msgrec_text) + leaf->msgrec_length, sizeof (SLONG)))

View File

@ -166,7 +166,7 @@ int CLIB_ROUTINE main( int argc, char** argv)
/* make sure the path name ends in a '/' */ /* make sure the path name ends in a '/' */
if (pathname) { if (pathname) {
size_t len = strlen(pathname); const size_t len = strlen(pathname);
//fb_assert(len + 1 < MAXPATHLEN); //fb_assert(len + 1 < MAXPATHLEN);
if (pathname[len - 1] != path_separator) { if (pathname[len - 1] != path_separator) {
pathname[len] = 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 // Divy up memory among various buffers
// Memory leaking until the program finishes? // 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; msgrec* const leaf = leaf_node;
const TEXT* const end_leaf = (TEXT*) leaf + MSG_BUCKET; const TEXT* const end_leaf = (TEXT*) leaf + MSG_BUCKET;