- at least builds on x86 using gcc 4.1
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 24 Dec 2005 16:00:35 +0000 (16:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    Firebird-gcc4.patch -> 1.3

Firebird-gcc4.patch

index cea3a87daa75a3f192afca496b11ba6219c11017..08a84e0c2810c622e6927a99829ab5c15ada072f 100644 (file)
---- firebird-1.5.2.4731/src/common/classes/alloc.h~    2004-09-17 20:34:27.000000000 +0000
-+++ firebird-1.5.2.4731/src/common/classes/alloc.h     2005-05-02 23:30:18.351312952 +0000
-@@ -253,11 +253,11 @@
- #define FB_NEW(pool) new(pool,__FILE__,__LINE__)
- #define FB_NEW_RPT(pool,count) new(pool,count,__FILE__,__LINE__)
- #else
--static inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
-+inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
-       return pool.allocate(s);
- //    return pool.calloc(s);
- }
--static inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
-+inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
-       return pool.allocate(s);
- //    return pool.calloc(s);
- }
---- firebird-1.5.2.4731/src/common/config/config.h.orig        2005-05-02 23:33:31.284982576 +0000
-+++ firebird-1.5.2.4731/src/common/config/config.h     2005-05-02 23:36:57.674606584 +0000
-@@ -118,12 +118,12 @@
-       /*
-               Block size for the sorting manager
-       */
--      static int getSortMemBlockSize();
-+      static size_t getSortMemBlockSize();
-       /*
-               Memory usage limit for the sorting manager
-       */
--      static int getSortMemUpperLimit();
-+      static size_t getSortMemUpperLimit();
-       /*
-               Whether remote (NFS) files can be opened
-@@ -133,12 +133,12 @@
-       /*
-               Startup option for the guardian
-       */
--      static int getGuardianOption();
-+      static size_t getGuardianOption();
-       /*
-               CPU affinity mask
-       */
--      static int getCpuAffinityMask();
-+      static size_t getCpuAffinityMask();
-       /*
-               Old parameter ordering for backward compatibility with FB1/IB6.X
-@@ -148,7 +148,7 @@
-       /*
-               XDR buffer size
-       */
--      static int getTcpRemoteBufferSize();
-+      static size_t getTcpRemoteBufferSize();
-       /*
-               Disable Nagle algorithm
-@@ -158,37 +158,37 @@
-       /*
-               IPC client mapping
-       */
--      static int getIpcMapSize();
-+      static size_t getIpcMapSize();
-       /*
-               Default database cache size
-       */
--      static int getDefaultDbCachePages();
-+      static size_t getDefaultDbCachePages();
-       /*
-               Connection timeout
-       */
--      static int getConnectionTimeout();
-+      static size_t getConnectionTimeout();
-       /*
-               Dummy packet interval
-       */
--      static int getDummyPacketInterval();
-+      static size_t getDummyPacketInterval();
-       /*
-               Lock manager memory size
-       */
--      static int getLockMemSize();
-+      static size_t getLockMemSize();
-       /*
-               Lock manager semaphore count
-       */
--      static int getLockSemCount();
-+      static size_t getLockSemCount();
-       /*
-               Lock manager signal number
-       */
--      static int getLockSignal();
-+      static size_t getLockSignal();
-       /*
-               Lock manager grant order
-@@ -198,27 +198,27 @@
-       /*
-               Lock manager hash slots
-       */
--      static int getLockHashSlots();
-+      static size_t getLockHashSlots();
-       /*
-               Lock manager acquire spins
-       */
--      static int getLockAcquireSpins();
-+      static size_t getLockAcquireSpins();
-       /*
-               Event manager memory size
-       */
--      static int getEventMemSize();
-+      static size_t getEventMemSize();
-       /*
-               Deadlock timeout
-       */
--      static int getDeadlockTimeout();
-+      static size_t getDeadlockTimeout();
-       /*
-               Solaris stall value
-       */
--      static int getSolarisStallValue();
-+      static size_t getSolarisStallValue();
-       /*
-               Trace memory pools
-@@ -228,17 +228,17 @@
-       /*
-               Priority switch delay
-       */
--      static int getPrioritySwitchDelay();
-+      static size_t getPrioritySwitchDelay();
-       /*
-               Dead threads collection
-       */
--      static int getDeadThreadsCollection();
-+      static size_t getDeadThreadsCollection();
-       /*
-               Priority boost
-       */
--      static int getPriorityBoost();
-+      static size_t getPriorityBoost();
-       /*
-               Service name for remote protocols
-@@ -248,7 +248,7 @@
-       /*
-               Service port for INET
-       */
--      static int getRemoteServicePort();
-+      static size_t getRemoteServicePort();
-       /*
-               Pipe name for WNET
-@@ -263,17 +263,17 @@
-       /*
-               Unflushed writes number
-       */
--      static int getMaxUnflushedWrites();
-+      static size_t getMaxUnflushedWrites();
-       /*
-               Unflushed write time
-       */
--      static int getMaxUnflushedWriteTime();
-+      static size_t getMaxUnflushedWriteTime();
-       /*
-               Process priority level
-       */
--      static int getProcessPriorityLevel();
-+      static size_t getProcessPriorityLevel();
-       /*
-               Create window for IPC stuff
-@@ -288,7 +288,7 @@
-       /*
-               Port for event processing
-       */
--      static int getRemoteAuxPort();
-+      static size_t getRemoteAuxPort();
-       /*
-               Server binding NIC address
---- firebird-1.5.2.4731/src/common/config/config.cpp.orig      2005-05-02 23:33:35.531337032 +0000
-+++ firebird-1.5.2.4731/src/common/config/config.cpp   2005-05-02 23:36:03.720808808 +0000
-@@ -257,14 +257,14 @@
-       return result ? result : sysConfig.root_dir;
- }
--int Config::getSortMemBlockSize()
-+size_t Config::getSortMemBlockSize()
- {
--      return (int) sysConfig.values[KEY_SORT_MEM_BLOCK_SIZE];
-+      return (size_t) sysConfig.values[KEY_SORT_MEM_BLOCK_SIZE];
- }
--int Config::getSortMemUpperLimit()
-+size_t Config::getSortMemUpperLimit()
- {
--      return (int) sysConfig.values[KEY_SORT_MEM_UPPER_LIMIT];
-+      return (size_t) sysConfig.values[KEY_SORT_MEM_UPPER_LIMIT];
- }
- bool Config::getRemoteFileOpenAbility()
-@@ -272,14 +272,14 @@
-       return (bool) sysConfig.values[KEY_REMOTE_FILE_OPEN_ABILITY];
- }
--int Config::getGuardianOption()
-+size_t Config::getGuardianOption()
- {
--      return (int) sysConfig.values[KEY_GUARDIAN_OPTION];
-+      return (size_t) sysConfig.values[KEY_GUARDIAN_OPTION];
- }
--int Config::getCpuAffinityMask()
-+size_t Config::getCpuAffinityMask()
- {
--      return (int) sysConfig.values[KEY_CPU_AFFINITY_MASK];
-+      return (size_t) sysConfig.values[KEY_CPU_AFFINITY_MASK];
- }
- bool Config::getOldParameterOrdering()
-@@ -287,9 +287,9 @@
-       return (bool) sysConfig.values[KEY_OLD_PARAMETER_ORDERING];
- }
--int Config::getTcpRemoteBufferSize()
-+size_t Config::getTcpRemoteBufferSize()
- {
--      return (int) sysConfig.values[KEY_TCP_REMOTE_BUFFER_SIZE];
-+      return (size_t) sysConfig.values[KEY_TCP_REMOTE_BUFFER_SIZE];
- }
- bool Config::getTcpNoNagle()
-@@ -297,39 +297,39 @@
-       return (bool) sysConfig.values[KEY_TCP_NO_NAGLE];
- }
--int Config::getIpcMapSize()
-+size_t Config::getIpcMapSize()
- {
--      return (int) sysConfig.values[KEY_IPC_MAP_SIZE];
-+      return (size_t) sysConfig.values[KEY_IPC_MAP_SIZE];
- }
--int Config::getDefaultDbCachePages()
-+size_t Config::getDefaultDbCachePages()
- {
--      return (int) sysConfig.values[KEY_DEFAULT_DB_CACHE_PAGES];
-+      return (size_t) sysConfig.values[KEY_DEFAULT_DB_CACHE_PAGES];
- }
--int Config::getConnectionTimeout()
-+size_t Config::getConnectionTimeout()
- {
--      return (int) sysConfig.values[KEY_CONNECTION_TIMEOUT];
-+      return (size_t) sysConfig.values[KEY_CONNECTION_TIMEOUT];
- }
--int Config::getDummyPacketInterval()
-+size_t Config::getDummyPacketInterval()
- {
--      return (int) sysConfig.values[KEY_DUMMY_PACKET_INTERVAL];
-+      return (size_t) sysConfig.values[KEY_DUMMY_PACKET_INTERVAL];
- }
--int Config::getLockMemSize()
-+size_t Config::getLockMemSize()
- {
--      return (int) sysConfig.values[KEY_LOCK_MEM_SIZE];
-+      return (size_t) sysConfig.values[KEY_LOCK_MEM_SIZE];
- }
--int Config::getLockSemCount()
-+size_t Config::getLockSemCount()
- {
--      return (int) sysConfig.values[KEY_LOCK_SEM_COUNT];
-+      return (size_t) sysConfig.values[KEY_LOCK_SEM_COUNT];
- }
--int Config::getLockSignal()
-+size_t Config::getLockSignal()
- {
--      return (int) sysConfig.values[KEY_LOCK_SIGNAL];
-+      return (size_t) sysConfig.values[KEY_LOCK_SIGNAL];
- }
- bool Config::getLockGrantOrder()
-@@ -337,29 +337,29 @@
-       return (bool) sysConfig.values[KEY_LOCK_GRANT_ORDER];
- }
--int Config::getLockHashSlots()
-+size_t Config::getLockHashSlots()
- {
--      return (int) sysConfig.values[KEY_LOCK_HASH_SLOTS];
-+      return (size_t) sysConfig.values[KEY_LOCK_HASH_SLOTS];
- }
--int Config::getLockAcquireSpins()
-+size_t Config::getLockAcquireSpins()
- {
--      return (int) sysConfig.values[KEY_LOCK_ACQUIRE_SPINS];
-+      return (size_t) sysConfig.values[KEY_LOCK_ACQUIRE_SPINS];
- }
--int Config::getEventMemSize()
-+size_t Config::getEventMemSize()
- {
--      return (int) sysConfig.values[KEY_EVENT_MEM_SIZE];
-+      return (size_t) sysConfig.values[KEY_EVENT_MEM_SIZE];
- }
--int Config::getDeadlockTimeout()
-+size_t Config::getDeadlockTimeout()
- {
--      return (int) sysConfig.values[KEY_DEADLOCK_TIMEOUT];
-+      return (size_t) sysConfig.values[KEY_DEADLOCK_TIMEOUT];
- }
--int Config::getSolarisStallValue()
-+size_t Config::getSolarisStallValue()
- {
--      return (int) sysConfig.values[KEY_SOLARIS_STALL_VALUE];
-+      return (size_t) sysConfig.values[KEY_SOLARIS_STALL_VALUE];
- }
- bool Config::getTraceMemoryPools()
-@@ -367,25 +367,25 @@
-       return (bool) sysConfig.values[KEY_TRACE_MEMORY_POOLS];
- }
--int Config::getPrioritySwitchDelay()
-+size_t Config::getPrioritySwitchDelay()
- {
--      int rc = (int) sysConfig.values[KEY_PRIORITY_SWITCH_DELAY];
-+      size_t rc = (size_t) sysConfig.values[KEY_PRIORITY_SWITCH_DELAY];
-       if (rc < 1)
-               rc = 1;
-       return rc;
- }
--int Config::getDeadThreadsCollection()
-+size_t Config::getDeadThreadsCollection()
- {
--      int rc = (int) sysConfig.values[KEY_DEAD_THREADS_COLLECTION];
-+      size_t rc = (size_t) sysConfig.values[KEY_DEAD_THREADS_COLLECTION];
-       if (rc < 1)
-               rc = 1;
-       return rc;
- }
--int Config::getPriorityBoost()
-+size_t Config::getPriorityBoost()
- {
--      int rc = (int) sysConfig.values[KEY_PRIORITY_BOOST];
-+      size_t rc = (size_t) sysConfig.values[KEY_PRIORITY_BOOST];
-       if (rc < 1)
-               rc = 1;
-       if (rc > 1000)
-@@ -398,9 +398,9 @@
-       return (const char*) sysConfig.values[KEY_REMOTE_SERVICE_NAME];
- }
--int Config::getRemoteServicePort()
-+size_t Config::getRemoteServicePort()
- {
--      return (int) sysConfig.values[KEY_REMOTE_SERVICE_PORT];
-+      return (size_t) sysConfig.values[KEY_REMOTE_SERVICE_PORT];
- }
- const char *Config::getRemotePipeName()
-@@ -413,19 +413,19 @@
-       return (const char*) sysConfig.values[KEY_IPC_NAME];
- }
--int Config::getMaxUnflushedWrites()
-+size_t Config::getMaxUnflushedWrites()
- {
--      return (int) sysConfig.values[KEY_MAX_UNFLUSHED_WRITES];
-+      return (size_t) sysConfig.values[KEY_MAX_UNFLUSHED_WRITES];
- }
--int Config::getMaxUnflushedWriteTime()
-+size_t Config::getMaxUnflushedWriteTime()
- {
--      return (int) sysConfig.values[KEY_MAX_UNFLUSHED_WRITE_TIME];
-+      return (size_t) sysConfig.values[KEY_MAX_UNFLUSHED_WRITE_TIME];
- }
--int Config::getProcessPriorityLevel()
-+size_t Config::getProcessPriorityLevel()
- {
--      return (int) sysConfig.values[KEY_PROCESS_PRIORITY_LEVEL];
-+      return (size_t) sysConfig.values[KEY_PROCESS_PRIORITY_LEVEL];
- }
- bool Config::getCreateInternalWindow()
-@@ -438,10 +438,10 @@
-       return (bool) sysConfig.values[KEY_COMPLETE_BOOLEAN_EVALUATION];
- }
--int Config::getRemoteAuxPort()
-+size_t Config::getRemoteAuxPort()
- {
- #ifdef SUPERSERVER
--      return (int) sysConfig.values[KEY_REMOTE_AUX_PORT];
-+      return (size_t) sysConfig.values[KEY_REMOTE_AUX_PORT];
- #else
-       return 0;
- #endif
---- firebird-1.5.2.4731/src/jrd/common.h.orig  2005-05-02 23:26:45.000000000 +0000
-+++ firebird-1.5.2.4731/src/jrd/common.h       2005-05-02 23:50:08.873326096 +0000
-@@ -864,8 +864,8 @@
- #define JRD_BUGCHK 15                 /* facility code for bugcheck messages */
- #ifndef OFFSET
--#define OFFSET(struct,fld)      ((int) &((struct) 0)->fld)
--#define OFFSETA(struct,fld)     ((int) ((struct) 0)->fld)
-+#define OFFSET(struct,fld)      ((size_t) &((struct) 0)->fld)
-+#define OFFSETA(struct,fld)     ((size_t) ((struct) 0)->fld)
- #endif
- #ifndef ODS_ALIGNMENT
---- firebird-1.5.2.4731/src/jrd/gds.cpp.orig   2005-05-02 23:39:56.000000000 +0000
-+++ firebird-1.5.2.4731/src/jrd/gds.cpp        2005-05-02 23:51:13.128557816 +0000
-@@ -2356,7 +2356,7 @@
-               return result;
-       if (stdio_flag)
--              if (!(result = ib_fdopen((int) result, "w+")))
-+              if (!(result = ib_fdopen((int)(IPTR) result, "w+")))
-                       return (void *)-1;
-       if (expanded_string)
---- firebird-1.5.2.4731/src/gpre/cmd.cpp~      2003-10-30 22:25:53.000000000 +0000
-+++ firebird-1.5.2.4731/src/gpre/cmd.cpp       2005-05-03 00:06:56.620125296 +0000
-@@ -204,7 +204,7 @@
-       case ACT_drop_shadow:
-               put_numeric(request, gds_dyn_delete_shadow,
--                                      (SSHORT) action->act_object);
-+                                      (SSHORT) (IPTR) action->act_object);
-               STUFF_END;
-               break;
---- firebird-1.5.2.4731/src/gpre/cme.cpp.orig  2005-05-03 00:16:24.976721960 +0000
-+++ firebird-1.5.2.4731/src/gpre/cme.cpp       2005-05-03 00:15:46.661546752 +0000
-@@ -251,7 +251,7 @@
- // ** Begin date/time/timestamp support *
-       case nod_extract:
-               STUFF(blr_extract);
--              switch ((KWWORDS) (int) node->nod_arg[0])
-+              switch ((KWWORDS) (IPTR) node->nod_arg[0])
-               {
-               case KW_YEAR:
-                       STUFF(blr_extract_year);
-@@ -478,7 +478,7 @@
- // ** Begin date/time/timestamp support *
-       case nod_extract:
-               {
--                      KWWORDS kw_word = (KWWORDS) (int) node->nod_arg[0];
-+                      KWWORDS kw_word = (KWWORDS) (IPTR) node->nod_arg[0];
-                       CME_get_dtype(node->nod_arg[1], f);
-                       switch (f->fld_dtype)
-                       {
---- firebird-1.5.2.4731/src/gpre/c_cxx.cpp.orig        2005-05-03 00:17:13.068891056 +0000
-+++ firebird-1.5.2.4731/src/gpre/c_cxx.cpp     2005-05-03 00:17:54.679565272 +0000
-@@ -2184,7 +2184,7 @@
-       args.pat_database = (DBB) init->nod_arg[3];
-       args.pat_vector1 = status_vector(action);
--      args.pat_value1 = (int) init->nod_arg[2];
-+      args.pat_value1 = (IPTR) init->nod_arg[2];
-       args.pat_value2 = (int) event_list->nod_count;
- //  generate call to dynamically generate event blocks 
-@@ -2255,7 +2255,7 @@
-               event_init = (GPRE_NOD) event_action->act_object;
-               stack_name = (SYM) event_init->nod_arg[0];
-               if (!strcmp(event_name->sym_string, stack_name->sym_string)) {
--                      ident = (int) event_init->nod_arg[2];
-+                      ident = (IPTR) event_init->nod_arg[2];
-                       database = (DBB) event_init->nod_arg[3];
-               }
-       }
---- firebird-1.5.2.4731/src/jrd/sdl.cpp~       2003-04-10 06:49:14.000000000 +0000
-+++ firebird-1.5.2.4731/src/jrd/sdl.cpp        2005-05-03 00:19:43.328048192 +0000
-@@ -699,7 +699,7 @@
-                       }
-                       element_desc = array_desc->ads_rpt[value].ads_desc;
-                       element_desc.dsc_address = (BLOB_PTR *) arg->sdl_arg_array +
--                              (SLONG) element_desc.dsc_address +
-+                              (IPTR) element_desc.dsc_address +
-                               (array_desc->ads_element_length * subscript);
-                       /* Is this element within the array bounds? */
---- firebird-1.5.2.4731/src/jrd/dpm.cpp.orig   2005-05-03 00:21:08.675073472 +0000
-+++ firebird-1.5.2.4731/src/jrd/dpm.cpp        2005-05-03 00:21:25.822466672 +0000
-@@ -2214,7 +2214,7 @@
-       DEBUG if (stack)
-               while (*stack)
--                      CCH_precedence(tdbb, &rpb->rpb_window, (SLONG) LLS_POP(stack));
-+                      CCH_precedence(tdbb, &rpb->rpb_window, (IPTR) LLS_POP(stack));
-       CCH_precedence(tdbb, &rpb->rpb_window, -rpb->rpb_transaction);
-       CCH_MARK(tdbb, &rpb->rpb_window);
-@@ -2831,7 +2831,7 @@
-    If the page need to be compressed, compress it. */
-       while (*stack)
--              CCH_precedence(tdbb, &rpb->rpb_window, (SLONG) LLS_POP(stack));
-+              CCH_precedence(tdbb, &rpb->rpb_window, (IPTR) LLS_POP(stack));
-       CCH_MARK(tdbb, &rpb->rpb_window);
-       i = page->dpg_count + ((slot) ? 0 : 1);
---- firebird-1.5.2.4731/src/jrd/met.cpp.orig   2005-05-03 00:22:57.523525992 +0000
-+++ firebird-1.5.2.4731/src/jrd/met.cpp        2005-05-03 00:24:20.650888712 +0000
-@@ -1541,7 +1541,7 @@
-                       if (desc->dsc_address)
-                       {
-                               format->fmt_length =
--                                      (ULONG) desc->dsc_address + desc->dsc_length;
-+                                      (IPTR) desc->dsc_address + desc->dsc_length;
-                               break;
-                       }
-               }
-@@ -3181,13 +3181,13 @@
+--- firebird-1.5.2.4731/src/jrd/met.epp.orig   2004-09-15 00:01:51.000000000 +0200
++++ firebird-1.5.2.4731/src/jrd/met.epp        2005-12-24 12:57:15.942243120 +0100
+@@ -2133,13 +2133,13 @@
                                 index_number < references->frgn_reference_ids->count();
                                 index_number++)
                        {
 -                              if (idx->idx_id == (UCHAR) (*references->frgn_reference_ids)
-+                              if (idx->idx_id == (IPTR) (*references->frgn_reference_ids)
++                              if (idx->idx_id == (UCHAR)(size_t) (*references->frgn_reference_ids)
                                                                                        [index_number])
                                {
                                        idx->idx_primary_relation =
 -                                              (USHORT) (*references->frgn_relations)[index_number];
-+                                              (IPTR) (*references->frgn_relations)[index_number];
++                                              (USHORT)(size_t) (*references->frgn_relations)[index_number];
                                        idx->idx_primary_index =
 -                                              (UCHAR) (*references->frgn_indexes)[index_number];
-+                                              (IPTR) (*references->frgn_indexes)[index_number];
++                                              (UCHAR)(size_t) (*references->frgn_indexes)[index_number];
                                        return TRUE;
                                }
                        }
-@@ -3203,7 +3203,7 @@
+@@ -2155,7 +2155,7 @@
                                 index_number < dependencies->prim_reference_ids->count();
                                 index_number++)
                        {
 -                              if (idx->idx_id == (UCHAR) (*dependencies->prim_reference_ids)
-+                              if (idx->idx_id == (IPTR) (*dependencies->prim_reference_ids)
++                              if (idx->idx_id == (UCHAR)(size_t) (*dependencies->prim_reference_ids)
                                                                                        [index_number])
                                {
                                        idx->idx_foreign_primaries =
-@@ -4182,10 +4182,10 @@
-               {
-                       if ( (node = csb_->csb_rpt[i].csb_message) )
-                       {
--                              if ((int) node->nod_arg[e_msg_number] == 0)
-+                              if ((IPTR) node->nod_arg[e_msg_number] == 0)
-                               {
-                                       procedure->prc_input_msg = node;
--                              } else if ((int) node->nod_arg[e_msg_number] == 1)
-+                              } else if ((IPTR) node->nod_arg[e_msg_number] == 1)
-                               {
-                                       procedure->prc_output_msg = node;
-                               }
-@@ -6141,7 +6141,7 @@
+@@ -4542,7 +4542,7 @@
                node = (JRD_NOD) LLS_POP(&csb->csb_dependencies);
                if (!node->nod_arg[e_dep_object])
                        continue;
 -              dpdo_type = (SSHORT) node->nod_arg[e_dep_object_type];
-+              dpdo_type = (IPTR) node->nod_arg[e_dep_object_type];
++              dpdo_type = (SSHORT)(size_t) node->nod_arg[e_dep_object_type];
          relation = NULL;
          procedure = NULL;
          switch (dpdo_type) {
-@@ -6154,13 +6154,13 @@
-             dpdo_name = (TEXT*) procedure->prc_name->str_data;
-             break;
-         case obj_exception:
--            number = (SLONG) node->nod_arg [e_dep_object];
-+            number = (IPTR) node->nod_arg [e_dep_object];
-             MET_lookup_exception (tdbb, number, name, NULL);
-             dpdo_name = name;
-             break;
-             /* CVC: Here I'm going to track those pesky things named generators and UDFs. */
-         case obj_generator:
--            number = (SLONG) node->nod_arg [e_dep_object];
-+            number = (IPTR) node->nod_arg [e_dep_object];
-             MET_lookup_generator_id (tdbb, number, name);
-             dpdo_name = name;
-             break;
-@@ -6178,7 +6178,7 @@
+@@ -4579,7 +4579,7 @@
                {
                        if (field_node->nod_type == nod_field)
                        {
 -                              fld_id = (SSHORT) field_node->nod_arg[0];
-+                              fld_id = (IPTR) field_node->nod_arg[0];
++                              fld_id = (SSHORT)(size_t) field_node->nod_arg[0];
                                if (relation)
                                {
                                        if ( (field = MET_get_field(relation, fld_id)) )
---- firebird-1.5.2.4731/src/jrd/blb.cpp.orig   2005-05-03 00:24:45.720077616 +0000
-+++ firebird-1.5.2.4731/src/jrd/blb.cpp        2005-05-03 00:24:58.563125176 +0000
-@@ -860,8 +860,8 @@
+--- firebird-1.5.2.4731/src/jrd/blb.cpp.orig   2004-04-27 03:44:57.000000000 +0200
++++ firebird-1.5.2.4731/src/jrd/blb.cpp        2005-12-24 13:08:13.803233048 +0100
+@@ -860,7 +860,7 @@
        request = tdbb->tdbb_request;
        source = (BID) from_desc->dsc_address;
        destination = (BID) to_desc->dsc_address;
 -      id = (USHORT) field->nod_arg[e_fld_id];
--      rpb = &request->req_rpb[(int) field->nod_arg[e_fld_stream]];
-+      id = (IPTR) field->nod_arg[e_fld_id];
-+      rpb = &request->req_rpb[(IPTR) field->nod_arg[e_fld_stream]];
++      id = (USHORT)(size_t) field->nod_arg[e_fld_id];
+       rpb = &request->req_rpb[(int) field->nod_arg[e_fld_stream]];
        relation = rpb->rpb_relation;
        record = rpb->rpb_record;
---- firebird-1.5.2.4731/src/jrd/cmp.cpp.orig   2005-05-03 00:25:15.000000000 +0000
-+++ firebird-1.5.2.4731/src/jrd/cmp.cpp        2005-05-03 00:32:27.036946792 +0000
+--- firebird-1.5.2.4731/src/jrd/cmp.cpp.orig   2004-12-03 08:59:29.000000000 +0100
++++ firebird-1.5.2.4731/src/jrd/cmp.cpp        2005-12-24 13:17:54.373972880 +0100
+@@ -487,7 +487,7 @@
+ /* Clone the request */
+       n =
+-              (USHORT) ((request->req_impure_size - REQ_SIZE + REQ_TAIL - 1) /
++              (USHORT)(size_t) ((request->req_impure_size - REQ_SIZE + REQ_TAIL - 1) /
+                                 REQ_TAIL);
+       clone = FB_NEW_RPT(*request->req_pool, n) jrd_req(request->req_pool);
+       (*vector)[level] = (BLK) clone;
 @@ -958,9 +958,9 @@
                        FMT format;
                        USHORT id;
  
 -                      id = (USHORT) node->nod_arg[e_fld_id];
-+                      id = (IPTR) node->nod_arg[e_fld_id];
++                      id = (USHORT)(size_t) node->nod_arg[e_fld_id];
                        format =
 -                              CMP_format(tdbb, csb, (USHORT) node->nod_arg[e_fld_stream]);
-+                              CMP_format(tdbb, csb, (IPTR) node->nod_arg[e_fld_stream]);
++                              CMP_format(tdbb, csb, (USHORT)(size_t) node->nod_arg[e_fld_stream]);
                        if (id >= format->fmt_count) {
                                desc->dsc_dtype = dtype_null;
                                desc->dsc_length = 0;
                        sub = node->nod_arg[e_scl_field];
                        relation =
 -                              csb->csb_rpt[(USHORT) sub->
-+                              csb->csb_rpt[(IPTR) sub->
++                              csb->csb_rpt[(USHORT)(size_t) sub->
                                                         nod_arg[e_fld_stream]].csb_relation;
 -                      id = (USHORT) sub->nod_arg[e_fld_id];
-+                      id = (IPTR) sub->nod_arg[e_fld_id];
++                      id = (USHORT)(size_t) sub->nod_arg[e_fld_id];
                        field = MET_get_field(relation, id);
                        if (!field || !(array = field->fld_array))
                                IBERROR(223);   /* msg 223 argument of scalar operation must be an array */
-@@ -1661,7 +1661,7 @@
-               return;
-       case nod_extract:
--              if ((ULONG) node->nod_arg[e_extract_part] == blr_extract_second) {
-+              if ((IPTR) node->nod_arg[e_extract_part] == blr_extract_second) {
-                       /* QUADDATE - SECOND returns a float, or scaled! */
-                       desc->dsc_dtype = dtype_long;
-                       desc->dsc_length = sizeof(ULONG);
-@@ -1720,7 +1720,7 @@
-                       message = node->nod_arg[e_arg_message];
-                       format = (FMT) message->nod_arg[e_msg_format];
--                      *desc = format->fmt_desc[(int) node->nod_arg[e_arg_number]];
-+                      *desc = format->fmt_desc[(IPTR) node->nod_arg[e_arg_number]];
-                       return;
-               }
 @@ -2651,8 +2651,8 @@
                                !input->nod_arg[e_fld_id] && !input->nod_arg[e_fld_stream])
                                --field_id;
                        else
 -                              field_id = (USHORT) input->nod_arg[e_fld_id];
 -                      stream = (USHORT) input->nod_arg[e_fld_stream];
-+                              field_id = (IPTR) input->nod_arg[e_fld_id];
-+                      stream = (IPTR) input->nod_arg[e_fld_stream];
++                              field_id = (USHORT)(size_t) input->nod_arg[e_fld_id];
++                      stream = (USHORT)(size_t) input->nod_arg[e_fld_stream];
                        if (remap_fld) {
                                JRD_REL relation;
                                JRD_FLD field;
                                field = MET_get_field(relation, field_id);
                                if (field->fld_source)
 -                                      field_id = (USHORT) field->fld_source->nod_arg[e_fld_id];
-+                                      field_id = (IPTR) field->fld_source->nod_arg[e_fld_id];
++                                      field_id = (USHORT)(size_t) field->fld_source->nod_arg[e_fld_id];
                        }
                        if (remap)
                                stream = remap[stream];
                        node->nod_count = 0;
  
 -                      stream = (USHORT) input->nod_arg[e_rel_stream];
-+                      stream = (IPTR) input->nod_arg[e_rel_stream];
++                      stream = (USHORT)(size_t) input->nod_arg[e_rel_stream];
        /** 
            Last entry in the remap contains the the original stream number.
            Get that stream number so that the flags can be copied 
                                copy(tdbb, csb, input->nod_arg[e_prc_inputs], remap, field_id,
                                         node->nod_arg[e_prc_in_msg], remap_fld);
 -                      stream = (USHORT) input->nod_arg[e_prc_stream];
-+                      stream = (IPTR) input->nod_arg[e_prc_stream];
++                      stream = (USHORT)(size_t) input->nod_arg[e_prc_stream];
                        new_stream = (*csb)->csb_n_stream++;
                        node->nod_arg[e_prc_stream] = (JRD_NOD) (SLONG) new_stream;
                        /* TMN: Here we should really have the following assert */
                        // SKIDDER: Maybe we need to check if we really found a procedure ?
                        element->csb_procedure = MET_lookup_procedure_id(tdbb,
 -                        (SSHORT)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
-+                        (IPTR)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
++                        (SSHORT)(size_t)node->nod_arg[e_prc_procedure],FALSE,FALSE,0);
  
                        (*csb)->csb_rpt[new_stream].csb_flags |=
                                (*csb)->csb_rpt[stream].csb_flags & csb_no_dbkey;
                node->nod_type = input->nod_type;
                node->nod_count = 0;
 -              stream = (USHORT) input->nod_arg[e_agg_stream];
-+              stream = (IPTR) input->nod_arg[e_agg_stream];
++              stream = (USHORT)(size_t) input->nod_arg[e_agg_stream];
                assert(stream <= MAX_STREAMS);
                new_stream = (*csb)->csb_n_stream++;
                assert(new_stream <= MAX_STREAMS);
                node->nod_type = input->nod_type;
                node->nod_count = 2;
 -              stream = (USHORT) input->nod_arg[e_uni_stream];
-+              stream = (IPTR) input->nod_arg[e_uni_stream];
++              stream = (USHORT)(size_t) input->nod_arg[e_uni_stream];
                new_stream = (*csb)->csb_n_stream++;
                node->nod_arg[e_uni_stream] = (JRD_NOD) (SLONG) new_stream;
                /* TMN: Here we should really have the following assert */
                        JRD_REL relation;
  
 -                      stream = (USHORT) node->nod_arg[e_rel_stream];
-+                      stream = (IPTR) node->nod_arg[e_rel_stream];
++                      stream = (USHORT)(size_t) node->nod_arg[e_rel_stream];
                        csb->csb_rpt[stream].csb_flags |= csb_no_dbkey;
                        tail = &csb->csb_rpt[stream];
                        if ( (relation = tail->csb_relation) )
                        UCHAR *map, local_map[MAP_LENGTH];
  
 -                      stream = (USHORT) node->nod_arg[e_fld_stream];
-+                      stream = (IPTR) node->nod_arg[e_fld_stream];
++                      stream = (USHORT)(size_t) node->nod_arg[e_fld_stream];
  
                        /* Look at all rse's which are lower in scope than the rse which this field 
                           is referencing, and mark them as varying -- the rule is that if a field 
                                !(field =
                                  MET_get_field(relation,
 -                                                              (USHORT) node->nod_arg[e_fld_id]))) break;
-+                                                              (IPTR) node->nod_arg[e_fld_id]))) break;
++                                                              (USHORT)(size_t) node->nod_arg[e_fld_id]))) break;
  
                        /* if this is a modify or store, check REFERENCES access to any foreign keys. */
  
                        sub = node->nod_arg[e_asgn_from];
                        if (sub->nod_type == nod_field) {
 -                              stream = (USHORT) sub->nod_arg[e_fld_stream];
-+                              stream = (IPTR) sub->nod_arg[e_fld_stream];
++                              stream = (USHORT)(size_t) sub->nod_arg[e_fld_stream];
                                field = MET_get_field((*csb)->csb_rpt[stream].csb_relation,
 -                                                                        (USHORT) sub->nod_arg[e_fld_id]);
-+                                                                        (IPTR) sub->nod_arg[e_fld_id]);
++                                                                        (USHORT)(size_t) sub->nod_arg[e_fld_id]);
                                if (field)
                                        node->nod_arg[e_asgn_missing2] = field->fld_missing_value;
                        }
                        if (sub->nod_type != nod_field)
                                break;
 -                      stream = (USHORT) sub->nod_arg[e_fld_stream];
-+                      stream = (IPTR) sub->nod_arg[e_fld_stream];
++                      stream = (USHORT)(size_t) sub->nod_arg[e_fld_stream];
                        tail = &(*csb)->csb_rpt[stream];
                        if (!
                                (field =
                                 MET_get_field(tail->csb_relation,
 -                                                         (USHORT) sub->nod_arg[e_fld_id]))) break;
-+                                                         (IPTR) sub->nod_arg[e_fld_id]))) break;
++                                                         (USHORT)(size_t) sub->nod_arg[e_fld_id]))) break;
                        if (field->fld_missing_value) {
                                node->nod_arg[e_asgn_missing] = field->fld_missing_value;
                                node->nod_count = 3;
  
        case nod_modify:
 -              stream = (USHORT) node->nod_arg[e_mod_new_stream];
-+              stream = (IPTR) node->nod_arg[e_mod_new_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
                tail = &(*csb)->csb_rpt[stream];
                tail->csb_flags |= csb_modify;
                pass1_modify(tdbb, csb, node);
                if ( (node->nod_arg[e_mod_validate] =
                        make_validation(tdbb, csb,
 -                                                      (USHORT) node->
-+                                                      (IPTR) node->
++                                                      (USHORT)(size_t) node->
                                                        nod_arg[e_mod_new_stream])) ) node->nod_count =
                                MAX(node->nod_count, (USHORT) e_mod_validate + 1);
                break;
  
        case nod_erase:
 -              stream = (USHORT) node->nod_arg[e_erase_stream];
-+              stream = (IPTR) node->nod_arg[e_erase_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_erase_stream];
                tail = &(*csb)->csb_rpt[stream];
                tail->csb_flags |= csb_erase;
                pass1_erase(tdbb, csb, node);
        case nod_store:
                sub = node->nod_arg[e_sto_relation];
 -              stream = (USHORT) sub->nod_arg[e_rel_stream];
-+              stream = (IPTR) sub->nod_arg[e_rel_stream];
++              stream = (USHORT)(size_t) sub->nod_arg[e_rel_stream];
                tail = &(*csb)->csb_rpt[stream];
                tail->csb_flags |= csb_store;
                sub = pass1_store(tdbb, csb, node);
                if (sub) {
 -                      stream = (USHORT) sub->nod_arg[e_rel_stream];
-+                      stream = (IPTR) sub->nod_arg[e_rel_stream];
++                      stream = (USHORT)(size_t) sub->nod_arg[e_rel_stream];
                        if ((!node->nod_arg[e_sto_sub_store]) &&
                                (node->nod_arg[e_sto_validate] =
                                 make_validation(tdbb, csb, stream))) node->nod_count =
        case nod_aggregate:
                assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
 -              (*csb)->csb_rpt[(USHORT) node->nod_arg[e_agg_stream]].csb_flags |=
-+              (*csb)->csb_rpt[(IPTR) node->nod_arg[e_agg_stream]].csb_flags |=
++              (*csb)->csb_rpt[(USHORT)(size_t) node->nod_arg[e_agg_stream]].csb_flags |=
                        csb_no_dbkey;
                ignore_dbkey(tdbb, *csb, (RSE) node->nod_arg[e_agg_rse], view);
                node->nod_arg[e_agg_rse] =
  
                        type = node->nod_type;
 -                      stream = (USHORT) node->nod_arg[0];
-+                      stream = (IPTR) node->nod_arg[0];
++                      stream = (USHORT)(size_t) node->nod_arg[0];
  
                        if (!(*csb)->csb_rpt[stream].csb_map) 
                                return node;
  
        case nod_cardinality:
 -              stream = (USHORT) node->nod_arg[e_card_stream];
-+              stream = (IPTR) node->nod_arg[e_card_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_card_stream];
                (*csb)->csb_rpt[stream].csb_flags |= csb_compute;
                break;
  
  
        for (;;) {
 -              stream = new_stream = (USHORT) node->nod_arg[e_erase_stream];
-+              stream = new_stream = (IPTR) node->nod_arg[e_erase_stream];
++              stream = new_stream = (USHORT)(size_t) node->nod_arg[e_erase_stream];
                tail = &(*csb)->csb_rpt[stream];
                tail->csb_flags |= csb_erase;
                relation = (*csb)->csb_rpt[stream].csb_relation;
                parent = relation;
                parent_stream = stream;
 -              new_stream = (USHORT) source->nod_arg[e_rel_stream];
-+              new_stream = (IPTR) source->nod_arg[e_rel_stream];
++              new_stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
                node->nod_arg[e_erase_stream] = (JRD_NOD) (SLONG) map[new_stream];
        }
  }
                                if (field->fld_source)
                                        new_id =
 -                                              (USHORT) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
-+                                              (IPTR) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
++                                              (USHORT)(size_t) (JRD_NOD) (field->fld_source)->nod_arg[e_fld_id];
                                else
                                        new_id = id;
                        }
        for (;;) {
 -              stream = (USHORT) node->nod_arg[e_mod_org_stream];
 -              new_stream = (USHORT) node->nod_arg[e_mod_new_stream];
-+              stream = (IPTR) node->nod_arg[e_mod_org_stream];
-+              new_stream = (IPTR) node->nod_arg[e_mod_new_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
++              new_stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
                tail = &(*csb)->csb_rpt[new_stream];
                tail->csb_flags |= csb_modify;
                relation = (*csb)->csb_rpt[stream].csb_relation;
                                MAX(node->nod_count, (USHORT) e_mod_map_view + 1);
                        map = (*csb)->csb_rpt[stream].csb_map;
 -                      stream = (USHORT) source->nod_arg[e_rel_stream];
-+                      stream = (IPTR) source->nod_arg[e_rel_stream];
++                      stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
                        stream = map[stream];
                        view_stream = new_stream;
  
                        map =
                                alloc_map(tdbb, csb,
 -                                                (SSHORT) node->nod_arg[e_mod_new_stream]);
-+                                                (IPTR) node->nod_arg[e_mod_new_stream]);
++                                                (SSHORT)(size_t) node->nod_arg[e_mod_new_stream]);
                        source = copy(tdbb, csb, source, map, 0, NULL, FALSE);
                        /* TMN: Here we should really have the following assert */
                        /* assert(source->nod_arg [e_rel_stream] <= MAX_UCHAR); */
 -                      map[new_stream] = (UCHAR) source->nod_arg[e_rel_stream];
-+                      map[new_stream] = (IPTR) source->nod_arg[e_rel_stream];
++                      map[new_stream] = (UCHAR)(size_t) source->nod_arg[e_rel_stream];
                        view_node = copy(tdbb, csb, node, map, 0, NULL, TRUE);
                        view_node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) stream;
                        view_node->nod_arg[e_mod_new_stream] =
                        view_node->nod_arg[e_mod_map_view] = NULL;
                        node->nod_arg[e_mod_sub_mod] = view_node;
 -                      new_stream = (USHORT) source->nod_arg[e_rel_stream];
-+                      new_stream = (IPTR) source->nod_arg[e_rel_stream];
++                      new_stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
                        view_node->nod_arg[e_mod_statement] =
                                pass1_expand_view(tdbb, *csb, view_stream, new_stream, TRUE);
                        node->nod_count =
  
                        map = (*csb)->csb_rpt[stream].csb_map;
 -                      stream = (USHORT) source->nod_arg[e_rel_stream];
-+                      stream = (IPTR) source->nod_arg[e_rel_stream];
++                      stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
                        node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) map[stream];
  
                        /* Next, do update stream */
                        map =
                                alloc_map(tdbb, csb,
 -                                                (SSHORT) node->nod_arg[e_mod_new_stream]);
-+                                                (IPTR) node->nod_arg[e_mod_new_stream]);
++                                                (SSHORT)(size_t) node->nod_arg[e_mod_new_stream]);
                        source = copy(tdbb, csb, source, map, 0, NULL, FALSE);
                        node->nod_arg[e_mod_new_stream] = source->nod_arg[e_rel_stream];
                }
                pass1(tdbb, csb, source, parent_view, view_stream, FALSE);
                procedure = MET_lookup_procedure_id(tdbb, 
 -                (SSHORT)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
-+                (IPTR)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
++                (SSHORT)(size_t)source->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
                post_procedure_access(tdbb, *csb, procedure);
                CMP_post_resource(&(*csb)->csb_resources, (BLK) procedure,
                                                  Resource::rsc_procedure, procedure->prc_id);
        source->nod_arg[e_rel_view] = (JRD_NOD) parent_view;
  
 -      stream = (USHORT) source->nod_arg[e_rel_stream];
-+      stream = (IPTR) source->nod_arg[e_rel_stream];
++      stream = (USHORT)(size_t) source->nod_arg[e_rel_stream];
        element = CMP_csb_element(csb, stream);
        element->csb_view = parent_view;
  /* TMN: Here we should really have the following assert */
                         vcx_ptr = &(*vcx_ptr)->vcx_next)
                        if ((*vcx_ptr)->vcx_context ==
 -                              (USHORT) source->nod_arg[e_rel_context]) {
-+                              (IPTR) source->nod_arg[e_rel_context]) {
++                              (USHORT)(size_t) source->nod_arg[e_rel_context]) {
                                element->csb_alias = (*vcx_ptr)->vcx_context_name;
                                break;
                        }
        for (;;) {
                original = node->nod_arg[e_sto_relation];
 -              stream = (USHORT) original->nod_arg[e_rel_stream];
-+              stream = (IPTR) original->nod_arg[e_rel_stream];
++              stream = (USHORT)(size_t) original->nod_arg[e_rel_stream];
                tail = &(*csb)->csb_rpt[stream];
                tail->csb_flags |= csb_store;
                relation = (*csb)->csb_rpt[stream].csb_relation;
                                copy(tdbb, csb, source, map, 0, NULL, FALSE);
                        new_stream =
 -                              (USHORT) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
-+                              (IPTR) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
++                              (USHORT)(size_t) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
                        node->nod_arg[e_sto_statement] =
                                pass1_expand_view(tdbb, *csb, stream, new_stream, TRUE);
                        node->nod_arg[e_sto_statement] =
                   active. So that the optimizer can use indices for 
                   eventually used sub-selects. */
 -              stream = (USHORT) node->nod_arg[e_mod_org_stream];
-+              stream = (IPTR) node->nod_arg[e_mod_org_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
                csb->csb_rpt[stream].csb_flags |= csb_active;
 -              stream = (USHORT) node->nod_arg[e_mod_new_stream];
-+              stream = (IPTR) node->nod_arg[e_mod_new_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
                csb->csb_rpt[stream].csb_flags |= csb_active;
        }
  
        if (node->nod_type == nod_modify) {
                /* AB: Remove the previous flags */
 -              stream = (USHORT) node->nod_arg[e_mod_org_stream];
-+              stream = (IPTR) node->nod_arg[e_mod_org_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
                csb->csb_rpt[stream].csb_flags &= ~csb_active;
 -              stream = (USHORT) node->nod_arg[e_mod_new_stream];
-+              stream = (IPTR) node->nod_arg[e_mod_new_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
                csb->csb_rpt[stream].csb_flags &= ~csb_active;
        }
  
                        fmt::fmt_desc_iterator desc;
  
 -                      stream = (USHORT) node->nod_arg[e_mod_org_stream];
-+                      stream = (IPTR) node->nod_arg[e_mod_org_stream];
++                      stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
                        csb->csb_rpt[stream].csb_flags |= csb_update;
                        format = CMP_format(tdbb, csb, stream);
                        desc = format->fmt_desc.begin();
  
        case nod_erase:
 -              stream = (USHORT) node->nod_arg[e_erase_stream];
-+              stream = (IPTR) node->nod_arg[e_erase_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_erase_stream];
                csb->csb_rpt[stream].csb_flags |= csb_update;
                break;
  
        case nod_field:
 -              stream = (USHORT) node->nod_arg[e_fld_stream];
 -              id = (USHORT) node->nod_arg[e_fld_id];
-+              stream = (IPTR) node->nod_arg[e_fld_stream];
-+              id = (IPTR) node->nod_arg[e_fld_id];
++              stream = (USHORT)(size_t) node->nod_arg[e_fld_stream];
++              id = (USHORT)(size_t) node->nod_arg[e_fld_id];
                SBM_set(tdbb, &csb->csb_rpt[stream].csb_fields, id);
                if (node->nod_flags & nod_value) {
                        csb->csb_impure += sizeof(struct vlux);
                pass2(tdbb, csb, node->nod_arg[e_agg_map], node);
                pass2(tdbb, csb, node->nod_arg[e_agg_group], node);
 -              stream = (USHORT) node->nod_arg[e_agg_stream];
-+              stream = (IPTR) node->nod_arg[e_agg_stream];
++              stream = (USHORT)(size_t) node->nod_arg[e_agg_stream];
                assert(stream <= MAX_STREAMS);
                process_map(tdbb, csb, node->nod_arg[e_agg_map],
                                        &csb->csb_rpt[stream].csb_format);
                node = *ptr;
                if (node->nod_type == nod_relation) {
 -                      USHORT stream = (USHORT) node->nod_arg[e_rel_stream];
-+                      USHORT stream = (IPTR) node->nod_arg[e_rel_stream];
++                      USHORT stream = (USHORT)(size_t) node->nod_arg[e_rel_stream];
                        csb->csb_rpt[stream].csb_flags |= csb_active;
                        pass2(tdbb, csb, node, (JRD_NOD) rse);
                }
                }
                else if (node->nod_type == nod_procedure) {
 -                      USHORT stream = (USHORT) node->nod_arg[e_prc_stream];
-+                      USHORT stream = (IPTR) node->nod_arg[e_prc_stream];
++                      USHORT stream = (USHORT)(size_t) node->nod_arg[e_prc_stream];
                        csb->csb_rpt[stream].csb_flags |= csb_active;
                        pass2(tdbb, csb, node, (JRD_NOD) rse);
                }
                else if (node->nod_type == nod_aggregate) {
 -                      USHORT stream = (USHORT) node->nod_arg[e_agg_stream];
-+                      USHORT stream = (IPTR) node->nod_arg[e_agg_stream];
++                      USHORT stream = (USHORT)(size_t) node->nod_arg[e_agg_stream];
                        assert(stream <= MAX_STREAMS);
                        csb->csb_rpt[stream].csb_flags |= csb_active;
                        pass2(tdbb, csb, node, (JRD_NOD) rse);
  
        clauses = node->nod_arg[e_uni_clauses];
 -      id = (USHORT) node->nod_arg[e_uni_stream];
-+      id = (IPTR) node->nod_arg[e_uni_stream];
++      id = (USHORT)(size_t) node->nod_arg[e_uni_stream];
        format = &csb->csb_rpt[id].csb_format;
  
  /* Process alternating rse and map blocks */
        for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end;
                 ptr++) if ((*ptr)->nod_type == nod_relation) {
 -                      stream = (USHORT) (*ptr)->nod_arg[e_rel_stream];
-+                      stream = (IPTR) (*ptr)->nod_arg[e_rel_stream];
++                      stream = (USHORT)(size_t) (*ptr)->nod_arg[e_rel_stream];
                        if (!(csb->csb_rpt[stream].csb_plan))
                                ERR_post(gds_no_stream_plan, gds_arg_string,
                                                 csb->csb_rpt[stream].csb_relation->rel_name, 0);
  /* find the tail for the relation specified in the rse */
  
 -      stream = (USHORT) plan_relation_node->nod_arg[e_rel_stream];
-+      stream = (IPTR) plan_relation_node->nod_arg[e_rel_stream];
++      stream = (USHORT)(size_t) plan_relation_node->nod_arg[e_rel_stream];
        tail = &csb->csb_rpt[stream];
  
  /* if the plan references a view, find the real base relation 
                node = *ptr;
                if (node->nod_type == nod_relation) {
 -                      USHORT stream = (USHORT) node->nod_arg[e_rel_stream];
-+                      USHORT stream = (IPTR) node->nod_arg[e_rel_stream];
++                      USHORT stream = (USHORT)(size_t) node->nod_arg[e_rel_stream];
                        csb->csb_rpt[stream].csb_flags &= ~csb_active;
                }
                else if (node->nod_type == nod_procedure) {
 -                      USHORT stream = (USHORT) node->nod_arg[e_prc_stream];
-+                      USHORT stream = (IPTR) node->nod_arg[e_prc_stream];
++                      USHORT stream = (USHORT)(size_t) node->nod_arg[e_prc_stream];
                        csb->csb_rpt[stream].csb_flags &= ~csb_active;
                }
                else if (node->nod_type == nod_aggregate) {
 -                      USHORT stream = (USHORT) node->nod_arg[e_agg_stream];
-+                      USHORT stream = (IPTR) node->nod_arg[e_agg_stream];
++                      USHORT stream = (USHORT)(size_t) node->nod_arg[e_agg_stream];
                        assert(stream <= MAX_STREAMS);
                        csb->csb_rpt[stream].csb_flags &= ~csb_active;
                }
                assignment = *ptr;
                field = assignment->nod_arg[e_asgn_to];
 -              id = (USHORT) field->nod_arg[e_fld_id];
-+              id = (IPTR) field->nod_arg[e_fld_id];
++              id = (USHORT)(size_t) field->nod_arg[e_fld_id];
                if (id >= format->fmt_count) {
                        format->fmt_desc.resize(id + 1);
                }
                   the sub-rse */
                if (sub->nod_type == nod_aggregate) {
 -                      if ((stream == (USHORT) sub->nod_arg[e_rel_stream]) ||
-+                      if ((stream == (IPTR) sub->nod_arg[e_rel_stream]) ||
++                      if ((stream == (USHORT)(size_t) sub->nod_arg[e_rel_stream]) ||
                                (stream_in_rse(stream, (RSE) sub->nod_arg[e_agg_rse])))
                                return TRUE;    /* do not mark as variant */
                }
  
                if ((sub->nod_type == nod_relation) &&
 -                      (stream == (USHORT) sub->nod_arg[e_rel_stream]))
-+                      (stream == (IPTR) sub->nod_arg[e_rel_stream]))
++                      (stream == (USHORT)(size_t) sub->nod_arg[e_rel_stream]))
                        return TRUE;            /* do not mark as variant */
        }
  
+--- firebird-1.5.2.4731/src/jrd/evl.cpp.orig   2004-10-12 17:34:39.000000000 +0200
++++ firebird-1.5.2.4731/src/jrd/evl.cpp        2005-12-24 13:31:35.388159752 +0100
+@@ -289,7 +289,7 @@
+               // All seem to work fine.
+               record =
+                       request->req_rpb[(int) node->nod_arg[e_fld_stream]].rpb_record;
+-              EVL_field(0, record, (USHORT) node->nod_arg[e_fld_id],
++              EVL_field(0, record, (USHORT)(size_t) node->nod_arg[e_fld_id],
+                                 &impure->vlu_desc);
+               if (!impure->vlu_desc.dsc_address)
+                       ERR_post(gds_read_only_field, 0);
+@@ -359,7 +359,7 @@
+                       impure = (INV) ((SCHAR *) tdbb->tdbb_request + node->nod_impure);
+                       SBM_reset(&impure->inv_bitmap);
+                       desc = EVL_expr(tdbb, node->nod_arg[0]);
+-                      id = 1 + 2 * (USHORT) node->nod_arg[1];
++                      id = 1 + 2 * (USHORT)(size_t) node->nod_arg[1];
+                       numbers = desc->dsc_address;
+                       numbers += id * sizeof(SLONG);
+                       MOVE_FAST(numbers, &rel_dbkey, sizeof(SLONG));
+@@ -856,9 +856,9 @@
+                        * the relation block is referenced. 
+                        * Reference: Bug 10116, 10424 
+                        */
+-                      if (!EVL_field(request->req_rpb[(USHORT) node->nod_arg[e_fld_stream]].rpb_relation,
++                      if (!EVL_field(request->req_rpb[(USHORT)(size_t) node->nod_arg[e_fld_stream]].rpb_relation,
+                                                       record,
+-                                                      (USHORT) node->nod_arg[e_fld_id],
++                                                      (USHORT)(size_t) node->nod_arg[e_fld_id],
+                                                       &impure->vlu_desc))
+                       {
+                               request->req_flags |= req_null;
+@@ -1725,7 +1725,7 @@
+       {
+               from = (*ptr)->nod_arg[e_asgn_from];
+               field = (*ptr)->nod_arg[e_asgn_to];
+-              id = (USHORT) field->nod_arg[e_fld_id];
++              id = (USHORT)(size_t) field->nod_arg[e_fld_id];
+               record =
+                       request->req_rpb[(int) field->nod_arg[e_fld_stream]].rpb_record;
+               impure = (VLUX) ((SCHAR *) request + from->nod_impure);
+--- firebird-1.5.2.4731/src/jrd/exe.cpp.orig   2004-11-06 07:07:51.000000000 +0100
++++ firebird-1.5.2.4731/src/jrd/exe.cpp        2005-12-24 13:33:42.787792064 +0100
+@@ -375,7 +375,7 @@
+       if (to->nod_type == nod_field)
+       {
+-              SSHORT id = (USHORT) to->nod_arg[e_fld_id];
++              SSHORT id = (USHORT)(size_t) to->nod_arg[e_fld_id];
+               REC record = request->req_rpb[(int) to->nod_arg[e_fld_stream]].rpb_record;
+               if (null) {
+                       SET_NULL(record, id);
+@@ -639,7 +639,7 @@
+       message = request->req_message;
+       format = (FMT) message->nod_arg[e_msg_format];
+-      if (msg != (USHORT) message->nod_arg[e_msg_number])
++      if (msg != (USHORT)(size_t) message->nod_arg[e_msg_number])
+               ERR_post(gds_req_sync, 0);
+       if (length != format->fmt_length)
+@@ -788,7 +788,7 @@
+               for (ptr = node->nod_arg, end = ptr + node->nod_count; ptr < end;
+                        ptr++) {
+                       message = (*ptr)->nod_arg[e_send_message];
+-                      if ((USHORT) message->nod_arg[e_msg_number] == msg) {
++                      if ((USHORT)(size_t) message->nod_arg[e_msg_number] == msg) {
+                               request->req_next = *ptr;
+                               break;
+                       }
+@@ -798,7 +798,7 @@
+       format = (FMT) message->nod_arg[e_msg_format];
+-      if (msg != (USHORT) message->nod_arg[e_msg_number])
++      if (msg != (USHORT)(size_t) message->nod_arg[e_msg_number])
+               ERR_post(gds_req_sync, 0);
+       if (length != format->fmt_length)
+@@ -2016,7 +2016,7 @@
+                       case jrd_req::req_evaluate:
+                               if (transaction != dbb->dbb_sys_trans) {
+-                                      UCHAR operation = (UCHAR) node->nod_arg[e_sav_operation];
++                                      UCHAR operation = (UCHAR)(size_t) node->nod_arg[e_sav_operation];
+                                       TEXT * node_savepoint_name = (TEXT*) node->nod_arg[e_sav_name]; 
+                                       // Skip the savepoint created by EXE_start
+@@ -2329,7 +2329,7 @@
+                               break;
+                       case jrd_req::req_unwind:
+-                              if ((request->req_label == (USHORT) node->nod_arg[e_lbl_label]) &&
++                              if ((request->req_label == (USHORT)(size_t) node->nod_arg[e_lbl_label]) &&
+                                               (request->req_flags & (req_leave | req_error_handler))) {
+                                       request->req_flags &= ~req_leave;
+                                       request->req_operation = jrd_req::req_return;
+@@ -2343,7 +2343,7 @@
+               case nod_leave:
+                       request->req_flags |= req_leave;
+                       request->req_operation = jrd_req::req_unwind;
+-                      request->req_label = (USHORT) node->nod_arg[0];
++                      request->req_label = (USHORT)(size_t) node->nod_arg[0];
+                       node = node->nod_parent;
+                       break;
+@@ -2795,11 +2795,11 @@
+       transaction = request->req_transaction;
+       impure = (STA) ((SCHAR *) request + node->nod_impure);
+-      org_stream = (USHORT) node->nod_arg[e_mod_org_stream];
++      org_stream = (USHORT)(size_t) node->nod_arg[e_mod_org_stream];
+       org_rpb = &request->req_rpb[org_stream];
+       relation = org_rpb->rpb_relation;
+-      new_stream = (USHORT) node->nod_arg[e_mod_new_stream];
++      new_stream = (USHORT)(size_t) node->nod_arg[e_mod_new_stream];
+       new_rpb = &request->req_rpb[new_stream];
+ #ifdef PC_ENGINE
+@@ -3796,7 +3796,7 @@
+       JRD_REQ    request     = tdbb->tdbb_request;
+       JRD_TRA    transaction = request->req_transaction;
+       STA    impure      = (STA) ((SCHAR *) request + node->nod_impure);
+-      SSHORT stream      = (USHORT) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
++      SSHORT stream      = (USHORT)(size_t) node->nod_arg[e_sto_relation]->nod_arg[e_rel_stream];
+       RPB*   rpb         = &request->req_rpb[stream];
+       JRD_REL    relation    = rpb->rpb_relation;
+@@ -4202,8 +4202,8 @@
+                       if (node->nod_type == nod_field)
+                       {
+-                              stream = (USHORT) node->nod_arg[e_fld_stream];
+-                              id = (USHORT) node->nod_arg[e_fld_id];
++                              stream = (USHORT)(size_t) node->nod_arg[e_fld_stream];
++                              id = (USHORT)(size_t) node->nod_arg[e_fld_id];
+                               relation = request->req_rpb[stream].rpb_relation;
+                               if ((vector = relation->rel_fields) &&
+--- firebird-1.5.2.4731/src/jrd/ext.cpp.orig   2003-06-16 17:42:58.000000000 +0200
++++ firebird-1.5.2.4731/src/jrd/ext.cpp        2005-12-24 13:34:26.333172160 +0100
+@@ -266,7 +266,7 @@
+       record = rpb->rpb_record;
+       format = record->rec_format;
+-      offset = (SSHORT) format->fmt_desc[0].dsc_address;
++      offset = (SSHORT)(size_t) format->fmt_desc[0].dsc_address;
+       p = record->rec_data + offset;
+       l = record->rec_length - offset;
+@@ -528,7 +528,7 @@
+               }
+       }
+-      offset = (USHORT) format->fmt_desc[0].dsc_address;
++      offset = (USHORT)(size_t) format->fmt_desc[0].dsc_address;
+       p = record->rec_data + offset;
+       l = record->rec_length - offset;
+--- firebird-1.5.2.4731/src/jrd/idx.cpp.orig   2004-09-15 00:01:50.000000000 +0200
++++ firebird-1.5.2.4731/src/jrd/idx.cpp        2005-12-24 13:35:08.531757000 +0100
+@@ -1051,12 +1051,12 @@
+                        index_number < idx->idx_foreign_primaries->count();
+                        index_number++) {
+                       if (idx->idx_id !=
+-                              (UCHAR) (*idx->idx_foreign_primaries)[index_number]) continue;
++                              (UCHAR)(size_t) (*idx->idx_foreign_primaries)[index_number]) continue;
+                       partner_relation =
+                               MET_relation(tdbb,
+                                                        (int) (*idx->idx_foreign_relations)[index_number]);
+                       index_id =
+-                              (USHORT) (*idx->idx_foreign_indexes)[index_number];
++                              (USHORT)(size_t) (*idx->idx_foreign_indexes)[index_number];
+                       if ( (result =
+                               check_partner_index(tdbb, relation, record, transaction, idx,
+                                                                       partner_relation, index_id)) )
+--- firebird-1.5.2.4731/src/jrd/opt.cpp.orig   2004-11-27 16:57:53.000000000 +0100
++++ firebird-1.5.2.4731/src/jrd/opt.cpp        2005-12-24 13:42:07.610047416 +0100
+@@ -380,7 +380,7 @@
+               if (node->nod_type != nod_rse)
+               {
+-                      stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
++                      stream = (USHORT)(size_t) node->nod_arg[STREAM_INDEX(node)];
+                       assert(stream <= MAX_UCHAR);
+                       assert(beds[0] < MAX_STREAMS && beds[0] < MAX_UCHAR);
+                       beds[++beds[0]] = (UCHAR) stream;
+@@ -400,7 +400,7 @@
+                                                 (USHORT) (key_streams[0] - i));
+                       assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
+                       local_streams[++local_streams[0]] =
+-                              (UCHAR) node->nod_arg[e_uni_stream];
++                              (UCHAR)(size_t) node->nod_arg[e_uni_stream];
+               }
+               else if (node->nod_type == nod_aggregate) {
+                       assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
+@@ -408,13 +408,13 @@
+                       rsb = gen_aggregate(tdbb, opt_, node);
+                       assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
+                       local_streams[++local_streams[0]] =
+-                              (UCHAR) node->nod_arg[e_agg_stream];
++                              (UCHAR)(size_t) node->nod_arg[e_agg_stream];
+               }
+               else if (node->nod_type == nod_procedure) {
+                       rsb = gen_procedure(tdbb, opt_, node);
+                       assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
+                       local_streams[++local_streams[0]] =
+-                              (UCHAR) node->nod_arg[e_prc_stream];
++                              (UCHAR)(size_t) node->nod_arg[e_prc_stream];
+               }
+               else if (node->nod_type == nod_rse) {
+                       compute_rse_streams(csb, (RSE) node, beds);
+@@ -895,7 +895,7 @@
+ /* Make sure we have the correct stream */
+-      if ((USHORT) dbkey->nod_arg[0] != stream)
++      if ((USHORT)(size_t) dbkey->nod_arg[0] != stream)
+               return NULL;
+ /* If this is a dbkey for the appropriate stream, it's invertable */
+@@ -1687,7 +1687,7 @@
+       switch (node->nod_type) {
+       case nod_field:
+-              n = (USHORT) node->nod_arg[e_fld_stream];
++              n = (USHORT)(size_t) node->nod_arg[e_fld_stream];
+               if (allowOnlyCurrentStream) {
+                       if (n != stream) {
+@@ -1713,7 +1713,7 @@
+       case nod_dbkey:
+-              n = (USHORT) node->nod_arg[0];
++              n = (USHORT)(size_t) node->nod_arg[0];
+               if (allowOnlyCurrentStream) {
+                       if (n != stream) {
+@@ -1784,7 +1784,7 @@
+       for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
+               if ((*ptr)->nod_type != nod_rse) {
+-                      n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
++                      n = (USHORT)(size_t) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
+                       csb->csb_rpt[n].csb_flags |= csb_active;
+               }
+       }
+@@ -1821,7 +1821,7 @@
+       {
+               if ((*ptr)->nod_type != nod_rse)
+               {
+-                      n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
++                      n = (USHORT)(size_t) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
+                       csb->csb_rpt[n].csb_flags &= ~csb_active;
+               }
+       }
+@@ -1862,12 +1862,12 @@
+       switch (node->nod_type) {
+       case nod_field:
+-              n = (USHORT) node->nod_arg[e_fld_stream];
++              n = (USHORT)(size_t) node->nod_arg[e_fld_stream];
+               SET_DEP_BIT(dependencies, n);
+               return;
+       case nod_dbkey:
+-              n = (USHORT) node->nod_arg[0];
++              n = (USHORT)(size_t) node->nod_arg[0];
+               SET_DEP_BIT(dependencies, n);
+               return;
+@@ -1923,7 +1923,7 @@
+       for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
+               if ((*ptr)->nod_type != nod_rse) {
+-                      n = (USHORT) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
++                      n = (USHORT)(size_t) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
+                       CLEAR_DEP_BIT(dependencies, n);
+               }
+       }
+@@ -1951,7 +1951,7 @@
+       if (node->nod_type == nod_relation) {
+               assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
+-              streams[++streams[0]] = (UCHAR) node->nod_arg[e_rel_stream];
++              streams[++streams[0]] = (UCHAR)(size_t) node->nod_arg[e_rel_stream];
+       }
+       else if (node->nod_type == nod_union) {
+               clauses = node->nod_arg[e_uni_clauses];
+@@ -1991,7 +1991,7 @@
+               node = *ptr;
+               if (node->nod_type != nod_rse) {
+                       assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
+-                      streams[++streams[0]] = (UCHAR) node->nod_arg[STREAM_INDEX(node)];
++                      streams[++streams[0]] = (UCHAR)(size_t) node->nod_arg[STREAM_INDEX(node)];
+               }
+               else {
+                       compute_rse_streams(csb, (RSE) node, streams);
+@@ -3289,7 +3289,7 @@
+       JRD_NOD dbkey_temp, *ptr, *end;
+       DEV_BLKCHK(dbkey, type_nod);
+       if (dbkey->nod_type == nod_dbkey) {
+-              if ((USHORT) dbkey->nod_arg[0] == stream)
++              if ((USHORT)(size_t) dbkey->nod_arg[0] == stream)
+                       return dbkey;
+               else {
+                       *position = *position + 1;
+@@ -3550,7 +3550,7 @@
+               temp[0]++;
+               relation_node = plan_node->nod_arg[e_retrieve_relation];
+-              temp[temp[0]] = (UCHAR) relation_node->nod_arg[e_rel_stream];
++              temp[temp[0]] = (UCHAR)(size_t) relation_node->nod_arg[e_rel_stream];
+       }
+       // just because the user specified a join does not mean that 
+@@ -3724,7 +3724,7 @@
+       rsb->rsb_type = rsb_aggregate;
+       assert((int)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
+       assert((int)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
+-      rsb->rsb_stream = (UCHAR) node->nod_arg[e_agg_stream];
++      rsb->rsb_stream = (UCHAR)(size_t) node->nod_arg[e_agg_stream];
+       rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
+       rsb->rsb_next = OPT_compile(tdbb, csb, rse, NULL);
+       rsb->rsb_arg[0] = (RSB) node;
+@@ -4088,8 +4088,8 @@
+                idx->idx_rpt; ptr < end; ptr++, idx_tail++) {
+               node = *ptr;
+               if (node->nod_type != nod_field
+-                      || (USHORT) node->nod_arg[e_fld_stream] != stream
+-                      || (USHORT) node->nod_arg[e_fld_id] != idx_tail->idx_field
++                      || (USHORT)(size_t) node->nod_arg[e_fld_stream] != stream
++                      || (USHORT)(size_t) node->nod_arg[e_fld_id] != idx_tail->idx_field
+                       || ptr[2*sort->nod_count] /* do not use index if NULLS FIRST is used */
+ #ifdef SCROLLABLE_CURSORS
+                       )
+@@ -4249,7 +4249,7 @@
+               {
+                       stream_ptr[i]->stream_rsb = NULL;
+                       stream_ptr[i]->stream_num =
+-                              (USHORT) node->nod_arg[STREAM_INDEX(node)];
++                              (USHORT)(size_t) node->nod_arg[STREAM_INDEX(node)];
+               }
+       }
+@@ -4327,10 +4327,10 @@
+       SET_TDBB(tdbb);
+       csb = opt->opt_csb;     
+       procedure = MET_lookup_procedure_id(tdbb,
+-         (SSHORT)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
++         (SSHORT)(size_t)node->nod_arg[e_prc_procedure], FALSE, FALSE, 0);
+       rsb = FB_NEW_RPT(*tdbb->tdbb_default, RSB_PRC_count) Rsb();
+       rsb->rsb_type = rsb_procedure;
+-      rsb->rsb_stream = (UCHAR) node->nod_arg[e_prc_stream];
++      rsb->rsb_stream = (UCHAR)(size_t) node->nod_arg[e_prc_stream];
+       rsb->rsb_procedure = procedure;
+       rsb->rsb_format = procedure->prc_format;
+       rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb_procedure));
+@@ -4943,8 +4943,8 @@
+                       for (node_ptr = sort->nod_arg; node_ptr < end_node; node_ptr++) {
+                               node = *node_ptr;
+                               if (node->nod_type == nod_field
+-                                      && (USHORT) node->nod_arg[e_fld_stream] == *ptr
+-                                      && (USHORT) node->nod_arg[e_fld_id] == id) {
++                                      && (USHORT)(size_t) node->nod_arg[e_fld_stream] == *ptr
++                                      && (USHORT)(size_t) node->nod_arg[e_fld_id] == id) {
+                                       desc = &descriptor;
+                                       CMP_get_desc(tdbb, csb, node, desc);
+                                       /* International type text has a computed key */
+@@ -5041,8 +5041,8 @@
+               map_item->smb_desc.dsc_address = (UCHAR *) map_length;
+               map_length += desc->dsc_length;
+               if (node->nod_type == nod_field) {
+-                      map_item->smb_stream = (USHORT) node->nod_arg[e_fld_stream];
+-                      map_item->smb_field_id = (USHORT) node->nod_arg[e_fld_id];
++                      map_item->smb_stream = (USHORT)(size_t) node->nod_arg[e_fld_stream];
++                      map_item->smb_field_id = (USHORT)(size_t) node->nod_arg[e_fld_id];
+               }
+       }
+@@ -5054,8 +5054,8 @@
+    field has already been mentioned as a sort key, don't bother to repeat
+    it. */
+       while (stream_stack) {
+-              id = (USHORT) LLS_POP(&id_stack);
+-              stream = (USHORT) LLS_POP(&stream_stack);
++              id = (USHORT)(size_t) LLS_POP(&id_stack);
++              stream = (USHORT)(size_t) LLS_POP(&stream_stack);
+               format = CMP_format(tdbb, csb, stream);
+               desc = &format->fmt_desc[id];
+               if (id >= format->fmt_count || desc->dsc_length == 0)
+@@ -5384,7 +5384,7 @@
+       rsb = FB_NEW_RPT(*tdbb->tdbb_default, count + nstreams + 1) Rsb();
+       rsb->rsb_type = rsb_union;
+       rsb->rsb_count = count;
+-      rsb->rsb_stream = (UCHAR) union_node->nod_arg[e_uni_stream];
++      rsb->rsb_stream = (UCHAR)(size_t) union_node->nod_arg[e_uni_stream];
+       rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
+       rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb));
+       rsb_ptr = rsb->rsb_arg;
+@@ -5926,8 +5926,8 @@
+       field = boolean->nod_arg[0];
+       if (field->nod_type != nod_field)
+               return NULL;
+-      if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
+-              (USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
++      if ((USHORT)(size_t) field->nod_arg[e_fld_stream] != stream ||
++              (USHORT)(size_t) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field)
+               return NULL;
+       node = make_index_node(tdbb, relation, opt->opt_csb, idx);
+       retrieval = (IRB) node->nod_arg[e_idx_retrieval];
+@@ -5995,8 +5995,8 @@
+                       return NULL;
+       }
+-      if ((USHORT) field->nod_arg[e_fld_stream] != stream ||
+-              (USHORT) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
++      if ((USHORT)(size_t) field->nod_arg[e_fld_stream] != stream ||
++              (USHORT)(size_t) field->nod_arg[e_fld_id] != idx->idx_rpt[0].idx_field
+               || !(idx->idx_rpt[0].idx_itype == idx_string
+                        || idx->idx_rpt[0].idx_itype == idx_byte_array
+                        || idx->idx_rpt[0].idx_itype == idx_metadata
+@@ -6094,10 +6094,10 @@
+               if (access_type) {
+                       for (arg = access_type->nod_arg, end = arg + plan_count;
+                                arg < end; arg += 3) {
+-                              if (relation_id != (SSHORT) * arg)
++                              if (relation_id != (SSHORT)(size_t) * arg)
+                                       /* index %s cannot be used in the specified plan */
+                                       ERR_post(gds_index_unused, gds_arg_string, *(arg + 2), 0);
+-                              if (idx->idx_id == (USHORT) * (arg + 1))
++                              if (idx->idx_id == (USHORT)(size_t) * (arg + 1))
+                                       if (access_type->nod_type == nod_navigational)
+                                               idx->idx_runtime_flags |= idx_plan_navigate;
+                                       else            /* nod_indices */
+@@ -6169,13 +6169,13 @@
+                  If left side is still not a field, give up */
+               if (match->nod_type != nod_field ||
+-                      (USHORT) match->nod_arg[e_fld_stream] != stream ||
++                      (USHORT)(size_t) match->nod_arg[e_fld_stream] != stream ||
+                       !computable(opt->opt_csb, value, stream, true, false))
+               {
+                       match = value;
+                       value = boolean->nod_arg[0];
+                       if (match->nod_type != nod_field ||
+-                              (USHORT) match->nod_arg[e_fld_stream] != stream ||
++                              (USHORT)(size_t) match->nod_arg[e_fld_stream] != stream ||
+                               !computable(opt->opt_csb, value, stream, true, false))
+                       {
+                               return 0;
+@@ -6194,7 +6194,7 @@
+ #ifdef EXPRESSION_INDICES
+                       (idx->idx_expression ||
+ #endif
+-                       ((USHORT) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
++                       ((USHORT)(size_t) match->nod_arg[e_fld_id] == idx->idx_rpt[i].idx_field)
+ #ifdef EXPRESSION_INDICES
+                       )
+ #endif
+@@ -6582,7 +6582,7 @@
+               return FALSE;
+       for (streams = river->riv_streams, end =
+                streams + river->riv_count; streams < end; streams++)
+-              if ((USHORT) node->nod_arg[e_fld_stream] == *streams)
++              if ((USHORT)(size_t) node->nod_arg[e_fld_stream] == *streams)
+                       return TRUE;
+       return FALSE;
+ }
+@@ -6779,7 +6779,7 @@
+                ptr < end; ptr++) {
+               node = *ptr;
+               if (node->nod_type != nod_rse) {
+-                      stream = (USHORT) node->nod_arg[STREAM_INDEX(node)];
++                      stream = (USHORT)(size_t) node->nod_arg[STREAM_INDEX(node)];
+                       csb->csb_rpt[stream].csb_flags &= ~csb_active;
+               }
+               else
+--- firebird-1.5.2.4731/src/jrd/par.cpp.orig   2004-06-19 10:11:45.000000000 +0200
++++ firebird-1.5.2.4731/src/jrd/par.cpp        2005-12-24 13:43:37.660357688 +0100
+@@ -2518,7 +2518,7 @@
+               node->nod_arg[e_agg_rse] = parse(tdbb, csb, TYPE_RSE);
+               node->nod_arg[e_agg_group] = parse(tdbb, csb, OTHER);
+               node->nod_arg[e_agg_map] =
+-                      par_map(tdbb, csb, (USHORT) node->nod_arg[e_agg_stream]);
++                      par_map(tdbb, csb, (USHORT)(size_t) node->nod_arg[e_agg_stream]);
+               break;
+       case blr_group_by:
+--- firebird-1.5.2.4731/src/jrd/rse.cpp.orig   2004-10-09 16:14:53.000000000 +0200
++++ firebird-1.5.2.4731/src/jrd/rse.cpp        2005-12-24 13:47:46.019601344 +0100
+@@ -730,8 +730,8 @@
+                               /* Initialize the record number of each stream in the union */
+                               ptr = &rsb->rsb_arg[rsb->rsb_count];
+-                              for (end = ptr + (USHORT) * ptr; ++ptr <= end;)
+-                                      request->req_rpb[(USHORT) * ptr].rpb_number = -1;
++                              for (end = ptr + (USHORT)(size_t) * ptr; ++ptr <= end;)
++                                      request->req_rpb[(USHORT)(size_t) * ptr].rpb_number = -1;
+                               rsb = rsb->rsb_arg[0];
+                       }
+@@ -2914,7 +2914,7 @@
+       request = tdbb->tdbb_request;
+       stack = (LLS) rsb->rsb_arg[streams];
+       for (; stack; stack = stack->lls_next) {
+-              rpb = &request->req_rpb[(USHORT) stack->lls_object];
++              rpb = &request->req_rpb[(USHORT)(size_t) stack->lls_object];
+               /* Make sure a record block has been allocated.  If there isn't
+                  one, first find the format, then allocate the record block */
+@@ -2972,7 +2972,7 @@
+                  list that contains the data to send back
+                */
+               if (IS_INTL_DATA(&item->smb_desc) &&
+-                      (USHORT) item->smb_desc.dsc_address <
++                      (USHORT)(size_t) item->smb_desc.dsc_address <
+                       map->smb_key_length * sizeof(ULONG)) continue;
+               rpb = &request->req_rpb[item->smb_stream];
+@@ -3238,7 +3238,7 @@
+                                  the sort record, then want to sort by language dependent order */
+                               if (IS_INTL_DATA(&item->smb_desc) &&
+-                                      (USHORT) item->smb_desc.dsc_address <
++                                      (USHORT)(size_t) item->smb_desc.dsc_address <
+                                       map->smb_key_length * sizeof(ULONG)) {
+                                       INTL_string_to_key(tdbb, INTL_INDEX_TYPE(&item->smb_desc),
+                                                                          from, &to, FALSE);
+--- firebird-1.5.2.4731/src/qli/command.cpp.orig       2003-04-03 11:34:54.000000000 +0200
++++ firebird-1.5.2.4731/src/qli/command.cpp    2005-12-24 15:04:12.438359712 +0100
+@@ -311,32 +311,32 @@
+       ptr = node->syn_arg;
+       for (i = 0; i < node->syn_count; i++) {
+-              foo = (USHORT) * ptr++;
++              foo = (USHORT)(size_t) * ptr++;
+               sw = (ENUM set_t) foo;
+               value = *ptr++;
+               switch (sw) {
+               case set_blr:
+-                      QLI_blr = (USHORT) value;
++                      QLI_blr = (USHORT)(size_t) value;
+                       break;
+               case set_statistics:
+-                      QLI_statistics = (USHORT) value;
++                      QLI_statistics = (USHORT)(size_t) value;
+                       break;
+               case set_columns:
+-                      QLI_name_columns = QLI_columns = (USHORT) value;
++                      QLI_name_columns = QLI_columns = (USHORT)(size_t) value;
+                       break;
+               case set_lines:
+-                      QLI_lines = (USHORT) value;
++                      QLI_lines = (USHORT)(size_t) value;
+                       break;
+               case set_semi:
+-                      QLI_semi = (USHORT) value;
++                      QLI_semi = (USHORT)(size_t) value;
+                       break;
+               case set_echo:
+-                      QLI_echo = (USHORT) value;
++                      QLI_echo = (USHORT)(size_t) value;
+                       break;
+               case set_form:
+@@ -399,7 +399,7 @@
+                       break;
+               case set_count:
+-                      QLI_count = (USHORT) value;
++                      QLI_count = (USHORT)(size_t) value;
+                       break;
+               case set_charset:
+--- firebird-1.5.2.4731/src/qli/expand.cpp.orig        2003-04-03 11:34:52.000000000 +0200
++++ firebird-1.5.2.4731/src/qli/expand.cpp     2005-12-24 15:04:49.271760184 +0100
+@@ -2220,7 +2220,7 @@
+       for (i = 0; i < node->nod_count; i++) {
+               expr = *syn_ptr++;
+               if (expr->syn_type == nod_position) {
+-                      position = (USHORT) expr->syn_arg[0];
++                      position = (USHORT)(size_t) expr->syn_arg[0];
+                       if (!list || !position || position > list->nod_count)
+                               IBERROR(152);   /* Msg152 invalid ORDER BY ordinal */
+                       item = (ITM) list->nod_arg[position - 1];
+--- firebird-1.5.2.4731/src/qli/meta.epp.orig  2004-09-17 22:34:59.000000000 +0200
++++ firebird-1.5.2.4731/src/qli/meta.epp       2005-12-24 15:20:58.941348000 +0100
+@@ -3795,7 +3795,7 @@
+       RLB rlb;
+-      privileges = (USHORT) node->syn_arg[s_grant_privileges];
++      privileges = (USHORT)(size_t) node->syn_arg[s_grant_privileges];
+       relation = (QLI_REL) node->syn_arg[s_grant_relation];
+       relation->rel_database = database = setup_update(relation->rel_database);
+       relation_name = relation->rel_symbol->sym_string;
+--- firebird-1.5.2.4731/src/burp/burp.cpp.orig 2004-01-07 11:10:18.000000000 +0100
++++ firebird-1.5.2.4731/src/burp/burp.cpp      2005-12-24 13:57:23.889751728 +0100
+@@ -1606,7 +1606,7 @@
+ #ifndef WIN_NT
+                               signal(SIGPIPE, SIG_IGN);
+ #endif
+-                              fil->fil_fd = reinterpret_cast<DESC>(GBAK_STDOUT_DESC);
++                              fil->fil_fd = (DESC)(GBAK_STDOUT_DESC);
+                               break;
+                       }
+                       else
+@@ -1724,7 +1724,7 @@
+       tdgbl->action->act_action = ACT_restore;
+       if (!strcmp(fil->fil_name, "stdin")) {
+-              fil->fil_fd = reinterpret_cast<DESC>(GBAK_STDIN_DESC);
++              fil->fil_fd = (DESC)(GBAK_STDIN_DESC);
+               tdgbl->file_desc = fil->fil_fd;
+               tdgbl->gbl_sw_files = fil->fil_next;
+       }
+--- firebird-1.5.2.4731/src/dsql/parse.cpp.orig        2004-01-31 14:31:48.000000000 +0100
++++ firebird-1.5.2.4731/src/dsql/parse.cpp     2005-12-24 16:11:42.519653768 +0100
+@@ -6431,7 +6431,7 @@
+ case 79:
+ { 
+                       lex.g_field->fld_dtype = dtype_cstring; 
+-                      lex.g_field->fld_character_length = (USHORT) yyvsp[-2]; }
++                      lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-2]; }
+ break;
+ case 80:
+ { yyval = (DSQL_NOD) NULL; }
+@@ -7551,27 +7551,27 @@
+ case 507:
+ { 
+                       lex.g_field->fld_dtype = dtype_blob; 
+-                      lex.g_field->fld_seg_length = (USHORT) yyvsp[-1];
++                      lex.g_field->fld_seg_length = (USHORT)(size_t) yyvsp[-1];
+                       lex.g_field->fld_sub_type = 0;
+                       }
+ break;
+ case 508:
+ { 
+                       lex.g_field->fld_dtype = dtype_blob; 
+-                      lex.g_field->fld_seg_length = (USHORT) yyvsp[-3];
+-                      lex.g_field->fld_sub_type = (USHORT) yyvsp[-1];
++                      lex.g_field->fld_seg_length = (USHORT)(size_t) yyvsp[-3];
++                      lex.g_field->fld_sub_type = (USHORT)(size_t) yyvsp[-1];
+                       }
+ break;
+ case 509:
+ { 
+                       lex.g_field->fld_dtype = dtype_blob; 
+                       lex.g_field->fld_seg_length = 80;
+-                      lex.g_field->fld_sub_type = (USHORT) yyvsp[-1];
++                      lex.g_field->fld_sub_type = (USHORT)(size_t) yyvsp[-1];
+                       }
+ break;
+ case 510:
+ {
+-                      lex.g_field->fld_seg_length = (USHORT) yyvsp[0];
++                      lex.g_field->fld_seg_length = (USHORT)(size_t) yyvsp[0];
+                       }
+ break;
+ case 511:
+@@ -7581,7 +7581,7 @@
+ break;
+ case 512:
+ {
+-                      lex.g_field->fld_sub_type = (USHORT) yyvsp[0];
++                      lex.g_field->fld_sub_type = (USHORT)(size_t) yyvsp[0];
+                       }
+ break;
+ case 513:
+@@ -7602,7 +7602,7 @@
+ case 517:
+ { 
+                       lex.g_field->fld_dtype = dtype_text; 
+-                      lex.g_field->fld_character_length = (USHORT) yyvsp[-1]; 
++                      lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-1]; 
+                       lex.g_field->fld_flags |= FLD_national;
+                       }
+ break;
+@@ -7616,14 +7616,14 @@
+ case 519:
+ { 
+                       lex.g_field->fld_dtype = dtype_varying; 
+-                      lex.g_field->fld_character_length = (USHORT) yyvsp[-1]; 
++                      lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-1]; 
+                       lex.g_field->fld_flags |= FLD_national;
+                       }
+ break;
+ case 520:
+ { 
+                       lex.g_field->fld_dtype = dtype_text; 
+-                      lex.g_field->fld_character_length = (USHORT) yyvsp[-1]; 
++                      lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-1]; 
+                       }
+ break;
+ case 521:
+@@ -7635,7 +7635,7 @@
+ case 522:
+ { 
+                       lex.g_field->fld_dtype = dtype_varying; 
+-                      lex.g_field->fld_character_length = (USHORT) yyvsp[-1]; 
++                      lex.g_field->fld_character_length = (USHORT)(size_t) yyvsp[-1]; 
+                       }
+ break;
+ case 531:
+@@ -7715,7 +7715,7 @@
+                               lex.g_field->fld_dtype = dtype_long; 
+                               lex.g_field->fld_length = sizeof (SLONG); 
+                               }
+-                      lex.g_field->fld_precision = (USHORT) yyvsp[-1];
++                      lex.g_field->fld_precision = (USHORT)(size_t) yyvsp[-1];
+                       }
+ break;
+ case 536:
+@@ -7775,8 +7775,8 @@
+                               lex.g_field->fld_length = sizeof (SLONG); 
+                               }
+                           }
+-                      lex.g_field->fld_precision = (USHORT) yyvsp[-3];
+-                      lex.g_field->fld_scale = - (SSHORT) yyvsp[-1];
++                      lex.g_field->fld_precision = (USHORT)(size_t) yyvsp[-3];
++                      lex.g_field->fld_scale = - (SSHORT)(size_t) yyvsp[-1];
+                       }
+ break;
+ case 539:
+@@ -7942,7 +7942,7 @@
+ { yyval = make_node (nod_table_lock, (int) 2, make_list (yyvsp[-1]), yyvsp[0]); }
+ break;
+ case 602:
+-{ yyval = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT) yyvsp[-1] | (SSHORT) yyvsp[0]), (SSHORT) 0, NULL); }
++{ yyval = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT)(size_t) yyvsp[-1] | (SSHORT)(size_t) yyvsp[0]), (SSHORT) 0, NULL); }
+ break;
+ case 603:
+ { yyval = 0; }
+--- firebird-1.5.2.4731/src/gpre/cmd.cpp.orig  2003-10-30 23:25:53.000000000 +0100
++++ firebird-1.5.2.4731/src/gpre/cmd.cpp       2005-12-24 12:30:50.312295512 +0100
+@@ -204,7 +204,7 @@
+       case ACT_drop_shadow:
+               put_numeric(request, gds_dyn_delete_shadow,
+-                                      (SSHORT) action->act_object);
++                                      (SSHORT)(size_t) action->act_object);
+               STUFF_END;
+               break;
+--- firebird-1.5.2.4731/src/common/classes/alloc.h.orig        2004-09-17 22:34:27.000000000 +0200
++++ firebird-1.5.2.4731/src/common/classes/alloc.h     2005-12-24 12:27:24.200629248 +0100
+@@ -242,22 +242,22 @@
+ void operator delete[](void* mem) throw();
+ #ifdef DEBUG_GDS_ALLOC
+-static inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
++inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
+       return pool.allocate(s, 0, file, line);
+ //    return pool.calloc(s, 0, file, line);
+ }
+-static inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
++inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
+       return pool.allocate(s, 0, file, line);
+ //    return pool.calloc(s, 0, file, line);
+ }
+ #define FB_NEW(pool) new(pool,__FILE__,__LINE__)
+ #define FB_NEW_RPT(pool,count) new(pool,count,__FILE__,__LINE__)
+ #else
+-static inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
++inline void* operator new(size_t s, Firebird::MemoryPool& pool) {
+       return pool.allocate(s);
+ //    return pool.calloc(s);
+ }
+-static inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
++inline void* operator new[](size_t s, Firebird::MemoryPool& pool) {
+       return pool.allocate(s);
+ //    return pool.calloc(s);
+ }
This page took 0.296151 seconds and 4 git commands to generate.