Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

locf.c

Go to the documentation of this file.
00001 /*
00002  * $Id: locf.c,v 1.2 2009/02/16 08:04:38 schubert Exp $
00003  *
00004  * Revision 1.1.1.1  2002/07/24 15:56:28  rdm
00005  * initial import into CVS
00006  *
00007  * Revision 1.1.1.1  2002/06/16 15:18:46  hristov
00008  * Separate distribution  of Geant3
00009  *
00010  * Revision 1.1.1.1  1999/05/18 15:55:28  fca
00011  * AliRoot sources
00012  *
00013  * Revision 1.3  1997/09/02 14:26:38  mclareni
00014  * WINNT correction
00015  *
00016  * Revision 1.2  1997/02/04 17:34:35  mclareni
00017  * Merge Winnt and 97a versions
00018  *
00019  * Revision 1.1.1.1.2.1  1997/01/21 11:29:36  mclareni
00020  * All mods for Winnt 96a on winnt branch
00021  *
00022  * Revision 1.1.1.1  1996/02/15 17:49:24  mclareni
00023  * Kernlib
00024  *
00025  */
00026 #include "kerngen/pilot.h"
00027 #include "kerngen/fortranc.h"
00028 #if defined(CERNLIB_LXIA64)
00029 #include "stdio.h"
00030 #endif
00031 
00032 #if defined(CERNLIB_MSSTDCALL) && defined(CERNLIB_LOCF_CHARACTER)
00033 # define Dummy2LocPar  ,_dummy
00034 # define DummyDef     int _dummy;
00035 #else
00036 # define Dummy2LocPar  
00037 # define DummyDef
00038 #endif
00039 
00040 #if defined(CERNLIB_QMIRTD)
00041 #include "irtdgs/locf.c"
00042 #elif defined(CERNLIB_QMVAOS)
00043 #include "vaogs/locf.c"
00044 #else
00045 /*>    ROUTINE LOCF
00046   CERN PROGLIB# N100    LOCF            .VERSION KERNFOR  4.36  930602
00047 */
00048 #define NADUPW 4   /* Number of ADdress Units Per Word */
00049 #define LADUPW 2   /* Logarithm base 2 of ADdress Units Per Word */
00050 #if defined(CERNLIB_QX_SC)
00051 unsigned int type_of_call locf_(iadr Dummy2LocPar)
00052 #elif defined(CERNLIB_QXNO_SC)
00053 unsigned int type_of_call locf(iadr Dummy2LocPar)
00054 #elif defined(CERNLIB_QXCAPT)
00055 unsigned int type_of_call LOCF(iadr Dummy2LocPar)
00056 #endif
00057    char *iadr;
00058 #ifdef DummDef
00059    DummyDef
00060 #endif
00061 {
00062 #if defined(CERNLIB_LXIA64)
00063   const unsigned long long int mask=0x00000000ffffffff;
00064   static unsigned long long int base=1;
00065   unsigned long long int jadr=(unsigned long long int) iadr;
00066   unsigned long long int jadrl = ((mask & jadr) >> LADUPW);
00067 
00068   if (base == 1) {
00069     base = (~mask & jadr);
00070   } else if(base != (~mask & jadr)) {
00071     printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
00072     printf("locf_() Warning: changing base from %lx to %lx!!!\n",
00073            base, (~mask & jadr));
00074     printf("This may result in program crash or incorrect results\n");
00075     printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
00076   }
00077   return ((unsigned) jadrl);
00078 #else
00079   return( ((unsigned) iadr) >> LADUPW );
00080 #endif
00081 }
00082 #undef Dummy2LocPar
00083 #undef DummyDef
00084 #undef CERNLIB_LOCF_CHARACTER
00085 /*> END <----------------------------------------------------------*/
00086 #endif
00087 

Generated on Mon Feb 15 11:06:53 2010 for loon by  doxygen 1.3.9.1