Index: Singular/Makefile.in
===================================================================
--- Singular/Makefile.in	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/Makefile.in	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -173,5 +173,5 @@
 	dbm_sl.h libparse.h \
 	gms.h pcv.h eigenval_ip.h \
-	feOpt.h fegetopt.h distrib.h walk.h \
+	fegetopt.h distrib.h walk.h \
         static.h\
         omSingularConfig.h
@@ -337,16 +337,16 @@
 extra.o: feOpt.inc
 
-feOpt.inc: feOpt.cc mod2.h feOpt.h
-	$(CXX) -DGENERATE_OPTION_INDEX feOpt.cc -o feOpt
+feOpt.inc: feOpt.cc mod2.h
+	$(CXX) -DGENERATE_OPTION_INDEX -I../kernel feOpt.cc -o feOpt
 	./feOpt
 	/bin/rm -f feOpt feOpt.exe
 
-feOptES.inc: feOpt.cc mod2.h feOpt.h
-	$(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR feOpt.cc -o feOpt
+feOptES.inc: feOpt.cc mod2.h 
+	$(CXX) -DGENERATE_OPTION_INDEX  -DESINGULAR -I../kernel feOpt.cc -o feOpt
 	./feOpt
 	rm -f feOpt feOpt.exe
 
-feOptTS.inc: feOpt.cc mod2.h feOpt.h
-	$(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR feOpt.cc -o feOpt
+feOptTS.inc: feOpt.cc mod2.h
+	$(CXX) -DGENERATE_OPTION_INDEX  -DTSINGULAR -I../kernel feOpt.cc -o feOpt
 	./feOpt
 	rm -f feOpt feOpt.exe
Index: Singular/attrib.cc
===================================================================
--- Singular/attrib.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/attrib.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: attrib.cc,v 1.23 2005-05-18 15:59:33 Singular Exp $ */
+/* $Id: attrib.cc,v 1.24 2005-07-27 15:47:52 Singular Exp $ */
 
 /*
@@ -368,5 +368,5 @@
       return TRUE;
     }
-    if (((int)c->Data())!=0)
+    if (((long)c->Data())!=0L)
     {
       if (h!=NULL) setFlag(h,FLAG_STD);
@@ -387,5 +387,5 @@
     }
     ideal I=(ideal)v->Data();
-    I->rank=si_max((int)I->rank,(int)c->Data());
+    I->rank=si_max((int)I->rank,(int)((long)c->Data()));
   }
   else if ((strcmp(name,"global")==0)
Index: Singular/extra.cc
===================================================================
--- Singular/extra.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/extra.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR      *
 *****************************************/
-/* $Id: extra.cc,v 1.228 2005-07-26 17:06:54 Singular Exp $ */
+/* $Id: extra.cc,v 1.229 2005-07-27 15:47:53 Singular Exp $ */
 /*
 * ABSTRACT: general interface to internals of Singular ("system" command)
@@ -421,7 +421,7 @@
           return TRUE;
         }
-        errormsg = feSetOptValue(opt, (int) h->Data());
+        errormsg = feSetOptValue(opt, (int)((long) h->Data()));
         if (errormsg != NULL)
-          Werror("Option '--%s=%d' %s", sys_cmd, (int) h->Data(), errormsg);
+          Werror("Option '--%s=%d' %s", sys_cmd, (int) ((long)h->Data()), errormsg);
       }
       else
@@ -448,5 +448,5 @@
       if ((h!=NULL) &&(h->Typ()==INT_CMD))
       {
-        siRandomStart=(int)h->Data();
+        siRandomStart=(int)((long)h->Data());
 #ifdef buildin_rand
         siSeed=siRandomStart;
@@ -483,5 +483,6 @@
             {
               res->rtyp=INT_CMD;
-              res->data=(void*)complexNearZero((gmp_complex*)h->Data(),(int)h->next->Data());
+              res->data=(void*)complexNearZero((gmp_complex*)h->Data(),
+			                       (int)((long)(h->next->Data())));
               return FALSE;
             }
@@ -613,5 +614,5 @@
        return TRUE;
      }
-     if(((int)h->next->Data())==1)
+     if(((long)h->next->Data())==1L)
        return spectrumfProc(res,h);
      return spectrumProc(res,h);
@@ -685,5 +686,5 @@
         if ((h!=NULL) && (h->Typ()==INT_CMD))
         {
-          a=(int)h->CopyD();
+          a=(int)((long)(h->Data()));
           h=h->next;
         }
@@ -691,5 +692,5 @@
         if ((h!=NULL) && (h->Typ()==INT_CMD))
         {
-          b=(int)h->CopyD();
+          b=(int)((long)(h->Data()));
           h=h->next;
         }
@@ -703,5 +704,5 @@
         if ((h!=NULL) && (h->Typ()==INT_CMD))
         {
-          metric=(int)h->CopyD();
+          metric=(int)((long)(h->Data()));
         }
         res->rtyp=MATRIX_CMD;
@@ -1126,5 +1127,5 @@
         return TRUE;
       }
-      if ((int) h->Data() != currRing->N)
+      if ((int) ((long)(h->Data())) != currRing->N)
       {
         Werror("system(\"Mivdp\" ...) intvecs not of length %d\n",
@@ -1132,5 +1133,5 @@
         return TRUE;
       }
-      int arg1 = (int) h->Data();
+      int arg1 = (int) ((long)(h->Data()));
 
       intvec* result = (intvec*) Mivdp(arg1);
@@ -1149,5 +1150,5 @@
         return TRUE;
       }
-      if ((int) h->Data() != currRing->N)
+      if ((int) ((long)(h->Data())) != currRing->N)
       {
         Werror("system(\"Mivlp\" ...) intvecs not of length %d\n",
@@ -1155,5 +1156,5 @@
         return TRUE;
       }
-      int arg1 = (int) h->Data();
+      int arg1 = (int) ((long)(h->Data()));
 
       intvec* result = (intvec*) Mivlp(arg1);
@@ -1312,5 +1313,5 @@
           return TRUE;
         }
-        int arg1 = (int) h->Data();
+        int arg1 = (int) ((long)(h->Data()));
 
         intvec* result = (intvec*) MivMatrixOrderdp(arg1);
@@ -1334,5 +1335,5 @@
         ideal arg1 = (ideal) h->Data();
         intvec* arg2 = (intvec*) h->next->Data();
-        int arg3 = (int) h->next->next->Data();
+        int arg3 = (int) ((long)(h->next->next->Data()));
 
         intvec* result = (intvec*) MPertVectors(arg1, arg2, arg3);
@@ -1356,5 +1357,5 @@
         ideal arg1 = (ideal) h->Data();
         intvec* arg2 = (intvec*) h->next->Data();
-        int arg3 = (int) h->next->next->Data();
+        int arg3 = (int) ((long)(h->next->next->Data()));
 
         intvec* result = (intvec*) MPertVectorslp(arg1, arg2, arg3);
@@ -1385,5 +1386,5 @@
      if(strcmp(sys_cmd, "MivUnit") == 0)
       {
-        int arg1 = (int) h->Data();
+        int arg1 = (int) ((long)(h->Data()));
 
         intvec* result = (intvec*) MivUnit(arg1);
@@ -1433,5 +1434,5 @@
           return TRUE;
         }
-        int arg1 = (int) h->Data();
+        int arg1 = (int) ((long)(h->Data()));
 
         intvec* result = (intvec*) MivMatrixOrderlp(arg1);
@@ -1615,9 +1616,9 @@
       }
       ideal arg1 = (ideal) h->Data();
-      int arg2 = (int) h->next->Data();
-      int arg3 = (int) h->next->next->Data();
+      int arg2 = (int) ((long)(h->next->Data()));
+      int arg3 = (int) ((long)(h->next->next->Data()));
       intvec* arg4 = (intvec*) h->next->next->next->Data();
       intvec* arg5   =  (intvec*) h->next->next->next->next->Data();
-      int arg6   =  (int) h->next->next->next->next->next->Data();
+      int arg6   =  (int) ((long)(h->next->next->next->next->next->Data()));
 
 
@@ -1652,6 +1653,6 @@
       }
       ideal arg1 = (ideal) h->Data();
-      int arg2 = (int) h->next->Data();
-      int arg3 = (int) h->next->next->Data();
+      int arg2 = (int) ((long)(h->next->Data()));
+      int arg3 = (int) ((long)(h->next->next->Data()));
       intvec* arg4 = (intvec*) h->next->next->next->Data();
       intvec* arg5   =  (intvec*) h->next->next->next->next->Data();
@@ -1812,5 +1813,5 @@
       intvec* arg2 = (intvec*) h->next->Data();
       intvec* arg3   =  (intvec*) h->next->next->Data();
-      int arg4   =  (int) h->next->next->next->Data();
+      int arg4   =  (int) ((long)(h->next->next->next->Data()));
 
       ideal result = (ideal) TranMImprovwalk(arg1, arg2, arg3, arg4);
@@ -1866,5 +1867,5 @@
           if (h != NULL && h->Typ() == INT_CMD)
           {
-            int n=(int)h->Data();
+            int n=(int)((long)h->Data());
             h=h->next;
             if (h != NULL && h->Typ() == INTVEC_CMD)
@@ -2092,5 +2093,5 @@
         struct itimerval t,o;
         memset(&t,0,sizeof(t));
-        t.it_value.tv_sec     =(unsigned)h->Data();
+        t.it_value.tv_sec     =(unsigned)((unsigned long)h->Data());
         setitimer(ITIMER_VIRTUAL,&t,&o);
         return FALSE;
@@ -2222,5 +2223,5 @@
     {
       int showproc=0;
-      if ((h!=NULL) && (h->Typ()==INT_CMD)) showproc=(int)h->Data();
+      if ((h!=NULL) && (h->Typ()==INT_CMD)) showproc=(int)((long)h->Data());
 #ifdef HAVE_NS
       listall(showproc);
@@ -2362,5 +2363,5 @@
       if ((h!=NULL) && (h->Typ()==INT_CMD))
       {
-        sdb_flags=(int)h->Data();
+        sdb_flags=(int)((long)h->Data());
       }
       else
@@ -2415,5 +2416,5 @@
       if ((h!=NULL) && (h->Typ()==INT_CMD))
       {
-        i2=(int)h->Data();
+        i2=(int)((long)h->Data());
       }
       else return TRUE;
@@ -2507,5 +2508,5 @@
       poly f = (poly)h->Data();
       h=h->next;
-      int n=(int)h->Data();
+      int n=(int)((long)h->Data());
       res->rtyp=POLY_CMD ;
       res->data=(void*) pFastPower(f,n,r);
@@ -2518,5 +2519,5 @@
       poly f = (poly)h->Data();
       h=h->next;
-      int n=(int)h->Data();
+      int n=(int)((long)h->Data());
       res->rtyp=POLY_CMD ;
       res->data=(void*) pPower(pCopy(f),n);
@@ -2529,5 +2530,5 @@
       poly f = (poly)h->Data();
       h=h->next;
-      int n=(int)h->Data();
+      int n=(int)((long)h->Data());
       res->rtyp=POLY_CMD ;
       res->data=(void*) pFastPowerMC(f,n,r);
Index: Singular/feOpt.cc
===================================================================
--- Singular/feOpt.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/feOpt.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: feOpt.cc,v 1.21 2003-02-20 13:49:32 Singular Exp $ */
+/* $Id: feOpt.cc,v 1.22 2005-07-27 15:47:54 Singular Exp $ */
 /*
 * ABSTRACT: Implementation of option buisness
@@ -397,5 +397,5 @@
 
       case FE_OPT_ECHO:
-        si_echo = (int) feOptSpec[FE_OPT_ECHO].value;
+        si_echo = (int) ((long)(feOptSpec[FE_OPT_ECHO].value));
         if (si_echo < 0 || si_echo > 9)
           return "argument of option is not in valid range 0..9";
@@ -403,5 +403,6 @@
 
       case FE_OPT_RANDOM:
-        siRandomStart = (unsigned int) feOptSpec[FE_OPT_RANDOM].value;
+        siRandomStart = (unsigned int) ((unsigned long)
+			                  (feOptSpec[FE_OPT_RANDOM].value));
 #ifdef buildin_rand
         siSeed=siRandomStart;
@@ -453,5 +454,5 @@
       case FE_OPT_TICKS_PER_SEC:
       {
-        int ticks = (int) feOptSpec[FE_OPT_TICKS_PER_SEC].value;
+        int ticks = (int) ((long)(feOptSpec[FE_OPT_TICKS_PER_SEC].value));
         if (ticks <= 0)
           return "integer argument must be larger than 0";
Index: Singular/grammar.y
===================================================================
--- Singular/grammar.y	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/grammar.y	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: grammar.y,v 1.113 2005-07-26 17:06:56 Singular Exp $ */
+/* $Id: grammar.y,v 1.114 2005-07-27 15:47:54 Singular Exp $ */
 /*
 * ABSTRACT: SINGULAR shell grammatik
@@ -115,5 +115,5 @@
      YYERROR;                                          \
    }                                                   \
-   (i) = (int)(a).Data();
+   (i) = (int)((long)(a).Data());
 
 #define MYYERROR(a) { WerrorS(a); YYERROR; }
@@ -1048,5 +1048,5 @@
                 if (sl->Typ() == INT_CMD)
                 {
-                  (*iv)[i++] = (int)(sl->Data());
+                  (*iv)[i++] = (int)((long)(sl->Data()));
                 }
                 else if ((sl->Typ() == INTVEC_CMD)
Index: Singular/iparith.cc
===================================================================
--- Singular/iparith.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/iparith.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: iparith.cc,v 1.371 2005-07-26 17:06:56 Singular Exp $ */
+/* $Id: iparith.cc,v 1.372 2005-07-27 15:47:55 Singular Exp $ */
 
 /*
@@ -405,5 +405,5 @@
 {
   intvec* aa= (intvec *)u->CopyD(INTVEC_CMD);
-  int bb = (int)(v->Data());
+  int bb = (int)(long)(v->Data());
   if (errorreported) return TRUE;
   switch (iiOp)
@@ -427,5 +427,5 @@
 {
   intvec* aa= (intvec *)u->CopyD(INTVEC_CMD);
-  int bb = (int)(v->Data());
+  int bb = (int)(long)(v->Data());
   int i=si_min(aa->rows(),aa->cols());
   switch (iiOp)
@@ -445,5 +445,5 @@
 static BOOLEAN jjDOTDOT(leftv res, leftv u, leftv v)
 {
-  res->data=(char *)new intvec((int)u->Data(),(int)v->Data());
+  res->data=(char *)new intvec((int)(long)u->Data(),(int)(long)v->Data());
   return FALSE;
 }
@@ -459,5 +459,5 @@
     iiOp=save_iiOp;
   }
-  if (iiOp==NOTEQUAL) res->data=(char *)(!(int)res->data);
+  if (iiOp==NOTEQUAL) res->data=(char *)(!(long)res->data);
 }
 static BOOLEAN jjCOMPARE_IV(leftv res, leftv u, leftv v)
@@ -491,5 +491,5 @@
 {
   intvec* a = (intvec * )(u->Data());
-  int     b = (int )     (v->Data());
+  int     b = (int)(long)(v->Data());
   int r=a->compare(b);
   switch  (iiOp)
@@ -615,6 +615,6 @@
 static BOOLEAN jjPOWER_I(leftv res, leftv u, leftv v)
 {
-  int b=(int)u->Data();
-  int e=(int)v->Data();
+  int b=(int)(long)u->Data();
+  int e=(int)(long)v->Data();
   int rc = 1;
   BOOLEAN overflow=FALSE;
@@ -652,5 +652,5 @@
 static BOOLEAN jjPOWER_N(leftv res, leftv u, leftv v)
 {
-  int e=(int)v->Data();
+  int e=(int)(long)v->Data();
   number n=(number)u->CopyD(NUMBER_CMD);
   if (e<0)
@@ -668,5 +668,5 @@
 static BOOLEAN jjPOWER_P(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)pPower((poly)u->CopyD(POLY_CMD),(int)v->Data());
+  res->data = (char *)pPower((poly)u->CopyD(POLY_CMD),(int)(long)v->Data());
   if (u!=NULL) return jjOP_REST(res,u,v);
   return FALSE;
@@ -674,5 +674,5 @@
 static BOOLEAN jjPOWER_ID(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)idPower((ideal)(u->Data()),(int)(v->Data()));
+  res->data = (char *)idPower((ideal)(u->Data()),(int)(long)(v->Data()));
   if (u!=NULL) return jjOP_REST(res,u,v);
   return FALSE;
@@ -792,6 +792,6 @@
 static BOOLEAN jjPLUS_I(leftv res, leftv u, leftv v)
 {
-  unsigned int a=(unsigned int)u->Data();
-  unsigned int b=(unsigned int)v->Data();
+  unsigned int a=(unsigned int)(unsigned long)u->Data();
+  unsigned int b=(unsigned int)(unsigned long)v->Data();
   unsigned int c=a+b;
   res->data = (char *)c;
@@ -864,6 +864,6 @@
 static BOOLEAN jjMINUS_I(leftv res, leftv u, leftv v)
 {
-  unsigned int a=(unsigned int)u->Data();
-  unsigned int b=(unsigned int)v->Data();
+  unsigned int a=(unsigned int)(unsigned long)u->Data();
+  unsigned int b=(unsigned int)(unsigned long)v->Data();
   unsigned int c=a-b;
   if (((Sy_bit(31)&a)!=(Sy_bit(31)&b))&&((Sy_bit(31)&a)!=(Sy_bit(31)&c)))
@@ -906,6 +906,6 @@
 static BOOLEAN jjTIMES_I(leftv res, leftv u, leftv v)
 {
-  int a=(int)u->Data();
-  int b=(int)v->Data();
+  int a=(int)(long)u->Data();
+  int b=(int)(long)v->Data();
   int c=a * b;
   if ((b!=0) && (c/b !=a))
@@ -994,5 +994,5 @@
 static BOOLEAN jjTIMES_MA_I1(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)mpMultI((matrix)u->CopyD(MATRIX_CMD),(int)v->Data());
+  res->data = (char *)mpMultI((matrix)u->CopyD(MATRIX_CMD),(int)(long)v->Data());
   return FALSE;
 }
@@ -1015,5 +1015,5 @@
 static BOOLEAN jjGE_I(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)((int)u->Data() >= (int)v->Data());
+  res->data = (char *)((long)u->Data() >= (long)v->Data());
   return FALSE;
 }
@@ -1027,5 +1027,5 @@
 static BOOLEAN jjGT_I(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)((int)u->Data()>(int)v->Data());
+  res->data = (char *)((long)u->Data()>(long)v->Data());
   return FALSE;
 }
@@ -1039,5 +1039,5 @@
 static BOOLEAN jjLE_I(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)((int)u->Data() <= (int)v->Data());
+  res->data = (char *)((long)u->Data() <= (long)v->Data());
   return FALSE;
 }
@@ -1051,5 +1051,5 @@
 static BOOLEAN jjLT_I(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)((int)u->Data() < (int)v->Data());
+  res->data = (char *)((int)(long)u->Data() < (int)(long)v->Data());
   return FALSE;
 }
@@ -1063,6 +1063,6 @@
 static BOOLEAN jjDIVMOD_I(leftv res, leftv u, leftv v)
 {
-  int a= (int) u->Data();
-  int b= (int) v->Data();
+  int a= (int)(long)u->Data();
+  int b= (int)(long)v->Data();
   if (b==0)
   {
@@ -1202,5 +1202,5 @@
 static BOOLEAN jjEQUAL_I(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)((int)u->Data() == (int)v->Data());
+  res->data = (char *)((int)(long)u->Data() == (int)(long)v->Data());
   jjEQUAL_REST(res,u,v);
   return FALSE;
@@ -1247,10 +1247,10 @@
 static BOOLEAN jjAND_I(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)((int)u->Data() && (int)v->Data());
+  res->data = (char *)((long)u->Data() && (long)v->Data());
   return FALSE;
 }
 static BOOLEAN jjOR_I(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)((int)u->Data() || (int)v->Data());
+  res->data = (char *)((long)u->Data() || (long)v->Data());
   return FALSE;
 }
@@ -1310,5 +1310,5 @@
 {
   poly p=(poly)u->Data();
-  int i=(int)v->Data();
+  int i=(int)(long)v->Data();
   int j=0;
   while (p!=NULL)
@@ -1358,5 +1358,5 @@
   poly r=p; // pointer to the beginning of component i
   poly o=NULL;
-  int i=(int)v->Data();
+  int i=(int)(long)v->Data();
   while (p!=NULL)
   {
@@ -1421,5 +1421,5 @@
   if(u->name==NULL) return TRUE;
   char * nn = (char *)omAlloc(strlen(u->name) + 14);
-  sprintf(nn,"%s(%d)",u->name,(int)v->Data());
+  sprintf(nn,"%s(%d)",u->name,(int)(long)v->Data());
   omFree((ADDRESS)u->name);
   u->name=NULL;
@@ -1673,5 +1673,5 @@
 static BOOLEAN jjEXTGCD_I(leftv res, leftv u, leftv v)
 {
-  int uu=(int)u->Data();int vv=(int)v->Data();
+  int uu=(int)(long)u->Data();int vv=(int)(long)v->Data();
   int p0=ABS(uu),p1=ABS(vv);
   int f0 = 1, f1 = 0, g0 = 0, g1 = 1, q, r;
@@ -1689,6 +1689,6 @@
   int a = f0;
   int b = g0;
-  if ( uu /*(int)u->Data()*/ < 0 ) a=-a;
-  if ( vv /*(int)v->Data()*/ < 0 ) b=-b;
+  if ( uu /*(int)(long)u->Data()*/ < 0 ) a=-a;
+  if ( vv /*(int)(long)v->Data()*/ < 0 ) b=-b;
   lists L=(lists)omAllocBin(slists_bin);
   L->Init(3);
@@ -1863,5 +1863,5 @@
 static BOOLEAN jjGCD_I(leftv res, leftv u, leftv v)
 {
-  int uu=(int)u->Data();int vv=(int)v->Data();
+  int uu=(int)(long)u->Data();int vv=(int)(long)v->Data();
   int p0=ABS(uu),p1=ABS(vv);
   int r;
@@ -1905,5 +1905,5 @@
   intvec *module_w=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
   intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currQuotient);
-  switch((int)v->Data())
+  switch((int)(long)v->Data())
   {
     case 1:
@@ -1944,5 +1944,5 @@
 {
   assumeStdFlag(u);
-  res->data=(void *)scIndIndset((ideal)(u->Data()),(int)(v->Data()),
+  res->data=(void *)scIndIndset((ideal)(u->Data()),(int)(long)(v->Data()),
                     currQuotient);
   return FALSE;
@@ -1956,14 +1956,14 @@
 static BOOLEAN jjJanetBasis2(leftv res, leftv u, leftv v)
 {
-  return jjStdJanetBasis(res,u,(int)v->Data());
+  return jjStdJanetBasis(res,u,(int)(long)v->Data());
 }
 static BOOLEAN jjJET_P(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)pJet((poly)u->CopyD(), (int)v->Data());
+  res->data = (char *)pJet((poly)u->CopyD(), (int)(long)v->Data());
   return FALSE;
 }
 static BOOLEAN jjJET_ID(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)idJet((ideal)u->Data(),(int)v->Data());
+  res->data = (char *)idJet((ideal)u->Data(),(int)(long)v->Data());
   return FALSE;
 }
@@ -1971,5 +1971,5 @@
 {
   assumeStdFlag(u);
-  res->data = (char *)scKBase((int)v->Data(),
+  res->data = (char *)scKBase((int)(long)v->Data(),
                               (ideal)(u->Data()),currQuotient);
   return FALSE;
@@ -2010,5 +2010,5 @@
 static BOOLEAN jjMINOR(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)idMinors((matrix)u->Data(),(int)v->Data());
+  res->data = (char *)idMinors((matrix)u->Data(),(int)(long)v->Data());
   return (res->data==NULL);
 }
@@ -2088,5 +2088,5 @@
 {
   idhdl h=(idhdl)u->data;
-  int i=(int)v->Data();
+  int i=(int)(long)v->Data();
   int p=0;
   if ((0<i)
@@ -2217,6 +2217,6 @@
 static BOOLEAN jjRANDOM(leftv res, leftv u, leftv v)
 {
-  int i=(int)u->Data();
-  int j=(int)v->Data();
+  int i=(int)(long)u->Data();
+  int j=(int)(long)v->Data();
 #ifdef buildin_rand
   res->data =(char *)((i > j) ? i : (siRand() % (j-i+1)) + i);
@@ -2261,5 +2261,5 @@
 static BOOLEAN jjRES(leftv res, leftv u, leftv v)
 {
-  int maxl=(int)v->Data();
+  int maxl=(int)(long)v->Data();
   if (maxl<0)
   {
@@ -2379,5 +2379,5 @@
 static BOOLEAN jjRES(leftv res, leftv u, leftv v)
 {
-  int maxl=(int)v->Data();
+  int maxl=(int)(long)v->Data();
   if (maxl<0)
   {
@@ -2500,5 +2500,5 @@
 static BOOLEAN jjSIMPL_ID(leftv res, leftv u, leftv v)
 {
-  int sw = (int)v->Data();
+  int sw = (int)(long)v->Data();
   // CopyD for IDEAL_CMD and MODUL_CMD are identical:
   ideal id = (ideal)u->CopyD(IDEAL_CMD);
@@ -2535,5 +2535,5 @@
 {
   intvec *v=NULL;
-  int sw=(int)dummy->Data();
+  int sw=(int)(long)dummy->Data();
   int fac_sw=sw;
   if ((sw<0)||(sw>2)) fac_sw=1;
@@ -2587,5 +2587,5 @@
 static BOOLEAN jjSIMPL_P(leftv res, leftv u, leftv v)
 {
-  int sw = (int)v->Data();
+  int sw = (int)(long)v->Data();
   // CopyD for POLY_CMD and VECTOR_CMD are identical:
   poly p = (poly)u->CopyD(POLY_CMD);
@@ -2645,5 +2645,5 @@
 {
   idhdl h=(idhdl)u->data;
-  int i=(int)v->Data();
+  int i=(int)(long)v->Data();
   if ((0<i) && (i<=IDRING(h)->N))
     res->data=omStrDup(IDRING(h)->names[i-1]);
@@ -2657,5 +2657,5 @@
 static BOOLEAN jjWEDGE(leftv res, leftv u, leftv v)
 {
-  res->data = (char *)mpWedge((matrix)u->Data(),(int)v->Data());
+  res->data = (char *)mpWedge((matrix)u->Data(),(int)(long)v->Data());
   return FALSE;
 }
@@ -3005,10 +3005,10 @@
 //static BOOLEAN jjPLUSPLUS(leftv res, leftv u)
 //{
-//  res->data = (char *)((int)u->Data()+1);
+//  res->data = (char *)((int)(long)u->Data()+1);
 //  return FALSE;
 //}
 //static BOOLEAN jjMINUSMINUS(leftv res, leftv u)
 //{
-//  res->data = (char *)((int)u->Data()-1);
+//  res->data = (char *)((int)(long)u->Data()-1);
 //  return FALSE;
 //}
@@ -3025,5 +3025,5 @@
 static BOOLEAN jjUMINUS_I(leftv res, leftv u)
 {
-  res->data = (char *)(-(int)u->Data());
+  res->data = (char *)(-(int)(long)u->Data());
   return FALSE;
 }
@@ -3246,5 +3246,5 @@
 {
   res->data = (char *)pOne();
-  pSetComp((poly)res->data,(int)v->Data());
+  pSetComp((poly)res->data,(int)(long)v->Data());
   pSetm((poly)res->data);
   return FALSE;
@@ -3566,5 +3566,5 @@
 {
   omUpdateInfo();
-  switch(((int)v->Data()))
+  switch(((int)(long)v->Data()))
   {
   case 0:
@@ -3645,5 +3645,5 @@
 static BOOLEAN jjPAR1(leftv res, leftv v)
 {
-  int i=(int)v->Data();
+  int i=(int)(long)v->Data();
   int p=0;
   p=rPar(currRing);
@@ -3671,5 +3671,5 @@
     return TRUE;
   }
-  int i=(int)v->Data();
+  int i=(int)(long)v->Data();
   int p=0;
   if ((0<i) && (currRing->parameter!=NULL) && (i<=(p=rPar(currRing))))
@@ -3702,5 +3702,5 @@
 static BOOLEAN jjPRIME(leftv res, leftv v)
 {
-  int i = IsPrime((int)(v->Data()));
+  int i = IsPrime((int)(long)(v->Data()));
   res->data = (char *)(i > 1 ? i : 2);
   return FALSE;
@@ -3927,5 +3927,5 @@
 static BOOLEAN jjTYPEOF(leftv res, leftv v)
 {
-  switch ((int)v->data)
+  switch ((int)(long)v->data)
   {
     case INT_CMD:     res->data=omStrDup("int"); break;
@@ -3955,5 +3955,5 @@
 static BOOLEAN jjVAR1(leftv res, leftv v)
 {
-  int i=(int)v->Data();
+  int i=(int)(long)v->Data();
   if ((0<i) && (i<=currRing->N))
   {
@@ -3977,5 +3977,5 @@
     return TRUE;
   }
-  int i=(int)v->Data();
+  int i=(int)(long)v->Data();
   if ((0<i) && (i<=currRing->N))
     res->data=omStrDup(currRing->names[i-1]);
@@ -4122,5 +4122,5 @@
         case (int)jjidTransp:     dArith1[i].p=(proc1)idTransp; break;
 #ifdef GENTABLE
-        default: Werror("missing proc1-definition for %d",(int)dArith1[i].p);
+        default: Werror("missing proc1-definition for %d",(int)(long)dArith1[i].p);
 #endif
       }
@@ -4153,5 +4153,5 @@
 static BOOLEAN jjidFreeModule(leftv res, leftv v)
 {
-  res->data = (char *)idFreeModule((int)v->Data());
+  res->data = (char *)idFreeModule((int)(long)v->Data());
   return FALSE;
 }
@@ -4180,5 +4180,5 @@
 static BOOLEAN jjidMaxIdeal(leftv res, leftv v)
 {
-  res->data = (char *)idMaxIdeal((int)v->Data());
+  res->data = (char *)idMaxIdeal((int)(long)v->Data());
   return FALSE;
 }
@@ -4530,6 +4530,6 @@
 {
   char *s= (char *)u->Data();
-  int   r = (int)v->Data();
-  int   c = (int)w->Data();
+  int   r = (int)(long)v->Data();
+  int   c = (int)(long)w->Data();
   int l = strlen(s);
 
@@ -4546,6 +4546,6 @@
 {
   intvec *iv = (intvec *)u->Data();
-  int   r = (int)v->Data();
-  int   c = (int)w->Data();
+  int   r = (int)(long)v->Data();
+  int   c = (int)(long)w->Data();
   if ((r<1)||(r>iv->rows())||(c<1)||(c>iv->cols()))
   {
@@ -4576,6 +4576,6 @@
 {
   matrix m= (matrix)u->Data();
-  int   r = (int)v->Data();
-  int   c = (int)w->Data();
+  int   r = (int)(long)v->Data();
+  int   c = (int)(long)w->Data();
   //Print("gen. elem %d, %d\n",r,c);
   if ((r<1)||(r>MATROWS(m))||(c<1)||(c>MATCOLS(m)))
@@ -4773,8 +4773,8 @@
   ideal m;
   lists l=(lists)omAllocBin(slists_bin);
-  int k=(int)w->Data();
+  int k=(int)(long)w->Data();
   if (k>=0)
   {
-    smCallNewBareiss((ideal)u->Data(),(int)v->Data(),(int)w->Data(),m,&iv);
+    smCallNewBareiss((ideal)u->Data(),(int)(long)v->Data(),(int)(long)w->Data(),m,&iv);
     l->Init(2);
     l->m[0].rtyp=MODUL_CMD;
@@ -4855,5 +4855,5 @@
   * or 0
   */
-  int n=(int)w->Data();
+  int n=(int)(long)w->Data();
   char *where=(char *)u->Data();
   char *what=(char *)v->Data();
@@ -4880,5 +4880,5 @@
 static BOOLEAN jjFWALK3(leftv res, leftv u, leftv v, leftv w)
 {
-  if ((int)w->Data()==0)
+  if ((int)(long)w->Data()==0)
     res->data=(char *)walkProc(u,v);
   else
@@ -4899,5 +4899,5 @@
   }
   intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currQuotient,wdegree);
-  switch((int)v->Data())
+  switch((int)(long)v->Data())
   {
     case 1:
@@ -4915,5 +4915,5 @@
 static BOOLEAN jjINTMAT3(leftv res, leftv u, leftv v,leftv w)
 {
-  intvec* im= new intvec((int)v->Data(),(int)w->Data(), 0);
+  intvec* im= new intvec((int)(long)v->Data(),(int)(long)w->Data(), 0);
   intvec* arg = (intvec*) u->Data();
   int i, n = si_min(im->cols()*im->rows(), arg->cols()*arg->rows());
@@ -4930,5 +4930,5 @@
 {
   short *iw=iv2array((intvec *)w->Data());
-  res->data = (char *)ppJetW((poly)u->Data(),(int)v->Data(),iw);
+  res->data = (char *)ppJetW((poly)u->Data(),(int)(long)v->Data(),iw);
   omFreeSize((ADDRESS)iw,(pVariables+1)*sizeof(short));
   return FALSE;
@@ -4941,10 +4941,10 @@
     return TRUE;
   }
-  res->data = (char *)pSeries((int)w->Data(),(poly)u->CopyD(),(poly)v->CopyD());
+  res->data = (char *)pSeries((int)(long)w->Data(),(poly)u->CopyD(),(poly)v->CopyD());
   return FALSE;
 }
 static BOOLEAN jjJET_ID_IV(leftv res, leftv u, leftv v, leftv w)
 {
-  res->data = (char *)idJetW((ideal)u->Data(),(int)v->Data(),
+  res->data = (char *)idJetW((ideal)u->Data(),(int)(long)v->Data(),
                              (intvec *)w->Data());
   return FALSE;
@@ -4957,5 +4957,5 @@
     return TRUE;
   }
-  res->data = (char *)idSeries((int)w->Data(),(ideal)u->CopyD(),
+  res->data = (char *)idSeries((int)(long)w->Data(),(ideal)u->CopyD(),
                                (matrix)v->CopyD());
   return FALSE;
@@ -4965,5 +4965,5 @@
   assumeStdFlag(w);
   res->data = (char *)idMinors(
-                        (matrix)u->Data(),(int)v->Data(),(ideal)w->Data());
+                        (matrix)u->Data(),(int)(long)v->Data(),(ideal)w->Data());
   return FALSE;
 }
@@ -5036,7 +5036,7 @@
 {
   int di, k;
-  int i=(int)u->Data();
-  int r=(int)v->Data();
-  int c=(int)w->Data();
+  int i=(int)(long)u->Data();
+  int r=(int)(long)v->Data();
+  int c=(int)(long)w->Data();
   if ((r<=0) || (c<=0)) return TRUE;
   intvec *iv = new intvec(r, c, 0);
@@ -5152,7 +5152,7 @@
 static BOOLEAN jjMATRIX_Id(leftv res, leftv u, leftv v,leftv w)
 {
-  matrix m=mpNew((int)v->Data(),(int)w->Data());
+  matrix m=mpNew((int)(long)v->Data(),(int)(long)w->Data());
   ideal I=(ideal)u->CopyD(IDEAL_CMD);
-  int i=si_min(IDELEMS(I),(int)v->Data()*(int)w->Data());
+  int i=si_min(IDELEMS(I),(int)(long)v->Data()*(int)(long)w->Data());
   //for(i=i-1;i>=0;i--)
   //{
@@ -5169,13 +5169,13 @@
 {
   res->data = (char *)idModule2formatedMatrix((ideal)u->CopyD(MODUL_CMD),
-           (int)v->Data(),(int)w->Data());
+           (int)(long)v->Data(),(int)(long)w->Data());
   return FALSE;
 }
 static BOOLEAN jjMATRIX_Ma(leftv res, leftv u, leftv v,leftv w)
 {
-  matrix m=mpNew((int)v->Data(),(int)w->Data());
+  matrix m=mpNew((int)(long)v->Data(),(int)(long)w->Data());
   matrix I=(matrix)u->CopyD(MATRIX_CMD);
-  int r=si_min(MATROWS(I),(int)v->Data());
-  int c=si_min(MATCOLS(I),(int)w->Data());
+  int r=si_min(MATROWS(I),(int)(long)v->Data());
+  int c=si_min(MATCOLS(I),(int)(long)w->Data());
   int i,j;
   for(i=r;i>0;i--)
@@ -5232,5 +5232,5 @@
   assumeStdFlag(v);
   res->data = (char *)kNF((ideal)v->Data(),currQuotient,(poly)u->Data(),
-    0,(int)w->Data());
+    0,(int)(long)w->Data());
   return FALSE;
 }
@@ -5239,5 +5239,5 @@
   assumeStdFlag(v);
   res->data = (char *)kNF((ideal)v->Data(),currQuotient,(ideal)u->Data(),
-    0,(int)w->Data());
+    0,(int)(long)w->Data());
   return FALSE;
 }
@@ -5425,5 +5425,5 @@
     if((v->next!=NULL) && (v->next->Typ()==INT_CMD))
     {
-      lineno=(int)v->next->Data();
+      lineno=(int)(long)v->next->Data();
     }
     return sdb_set_breakpoint(v->Name(),lineno);
@@ -5499,5 +5499,5 @@
   ideal Q=(ideal)w2.Data();
 
-  int n=(int)v3->Data();
+  int n=(int)(long)v3->Data();
   short *w=NULL;
   if(v4!=NULL)
@@ -5584,5 +5584,5 @@
       case INT_CMD:
       {
-        number n=nInit((int)h->Data());
+        number n=nInit((int)(long)h->Data());
         if (!nIsZero(n))
         {
@@ -5727,5 +5727,5 @@
     if(h->Typ()==INT_CMD)
     {
-      (*iv)[i]=(int)h->Data();
+      (*iv)[i]=(int)(long)h->Data();
     }
     else
@@ -5757,5 +5757,5 @@
     }
     res->rtyp=u1->Typ();
-    res->data=(char*)pSeries((int)u3->Data(),pCopy((poly)u1->Data()),
+    res->data=(char*)pSeries((int)(long)u3->Data(),pCopy((poly)u1->Data()),
                              pCopy((poly)u2->Data()),(intvec*)u4->Data());
     return FALSE;
@@ -5773,5 +5773,5 @@
     }
     res->rtyp=u1->Typ();
-    res->data=(char*)idSeries((int)u3->Data(),idCopy((ideal)u1->Data()),
+    res->data=(char*)idSeries((int)(long)u3->Data(),idCopy((ideal)u1->Data()),
                               mpCopy((matrix)u2->Data()),(intvec*)u4->Data());
     return FALSE;
@@ -5879,5 +5879,5 @@
   {
     int save_d=Kstd1_deg;
-    Kstd1_deg=(int)u3->Data();
+    Kstd1_deg=(int)(long)u3->Data();
     kModW=(intvec *)u4->Data();
     BITSET save=verbose;
@@ -5903,5 +5903,5 @@
     res->rtyp=IDEAL_CMD;
     res->data=(char*)redNF(idCopy((ideal)u3->Data()),idCopy((ideal)u1->Data()),
-                           mpCopy((matrix)u2->Data()),(int)u4->Data());
+                           mpCopy((matrix)u2->Data()),(int)(long)u4->Data());
     return FALSE;
   }
@@ -5918,5 +5918,5 @@
     res->rtyp=POLY_CMD;
     res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
-                           pCopy((poly)u2->Data()),(int)u4->Data());
+                           pCopy((poly)u2->Data()),(int)(long)u4->Data());
     return FALSE;
   }
@@ -5946,5 +5946,5 @@
     res->data=(char*)redNF(idCopy((ideal)u3->Data()),idCopy((ideal)u1->Data()),
                            mpCopy((matrix)u2->Data()),
-                           (int)u4->Data(),(intvec*)u5->Data());
+                           (int)(long)u4->Data(),(intvec*)u5->Data());
     return FALSE;
   }
@@ -5962,5 +5962,5 @@
     res->data=(char*)redNF(idCopy((ideal)u3->Data()),pCopy((poly)u1->Data()),
                            pCopy((poly)u2->Data()),
-                           (int)u4->Data(),(intvec*)u5->Data());
+                           (int)(long)u4->Data(),(intvec*)u5->Data());
     return FALSE;
   }
@@ -6026,5 +6026,5 @@
     if (v->Typ()!=INT_CMD)
       return TRUE;
-    test_cmd((int)v->Data());
+    test_cmd((int)(long)v->Data());
     v=v->next;
   }
@@ -6049,10 +6049,10 @@
   jjSTATUS3(res, v, v->next, v->next->next);
 #if defined(HAVE_USLEEP)
-  if (((int) res->data) == 0)
-  {
-    int i_s = (int) v->next->next->next->Data();
+  if (((long) res->data) == 0L)
+  {
+    int i_s = (int)(long) v->next->next->next->Data();
     if (i_s > 0)
     {
-      usleep((int) v->next->next->next->Data());
+      usleep((int)(long) v->next->next->next->Data());
       jjSTATUS3(res, v, v->next, v->next->next);
     }
@@ -6157,5 +6157,5 @@
   assume( e->Typ()==INT_CMD );
   Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin);
-  r->start =(int)e->Data();
+  r->start =(int)(long)e->Data();
   return r;
 }
Index: Singular/ipassign.cc
===================================================================
--- Singular/ipassign.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/ipassign.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: ipassign.cc,v 1.78 2005-07-22 16:22:10 levandov Exp $ */
+/* $Id: ipassign.cc,v 1.79 2005-07-27 15:47:56 Singular Exp $ */
 
 /*
@@ -41,25 +41,25 @@
 static BOOLEAN jjECHO(leftv res, leftv a)
 {
-  si_echo=(int)a->Data();
+  si_echo=(int)((long)(a->Data()));
   return FALSE;
 }
 static BOOLEAN jjPAGELENGTH(leftv res, leftv a)
 {
-  pagelength=(int)a->Data();
+  pagelength=(int)((long)(a->Data()));
   return FALSE;
 }
 static BOOLEAN jjPRINTLEVEL(leftv res, leftv a)
 {
-  printlevel=(int)a->Data();
+  printlevel=(int)((long)(a->Data()));
   return FALSE;
 }
 static BOOLEAN jjCOLMAX(leftv res, leftv a)
 {
-  colmax=(int)a->Data();
+  colmax=(int)((long)(a->Data()));
   return FALSE;
 }
 static BOOLEAN jjTIMER(leftv res, leftv a)
 {
-  timerv=(int)a->Data();
+  timerv=(int)((long)(a->Data()));
   initTimer();
   return FALSE;
@@ -68,5 +68,5 @@
 static BOOLEAN jjRTIMER(leftv res, leftv a)
 {
-  rtimerv=(int)a->Data();
+  rtimerv=(int)((long)(a->Data()));
   initRTimer();
   return FALSE;
@@ -75,5 +75,5 @@
 static BOOLEAN jjMAXDEG(leftv res, leftv a)
 {
-  Kstd1_deg=(int)a->Data();
+  Kstd1_deg=(int)((long)(a->Data()));
   if (Kstd1_deg!=0)
     test |=Sy_bit(24);
@@ -84,5 +84,5 @@
 static BOOLEAN jjMAXMULT(leftv res, leftv a)
 {
-  Kstd1_mu=(int)a->Data();
+  Kstd1_mu=(int)((long)(a->Data()));
   if (Kstd1_mu!=0)
     test |=Sy_bit(23);
@@ -93,5 +93,5 @@
 static BOOLEAN jjTRACE(leftv res, leftv a)
 {
-  traceit=(int)a->Data();
+  traceit=(int)((long)(a->Data()));
   return FALSE;
 }
@@ -100,5 +100,5 @@
   if (currRing != NULL)
   {
-    BOOLEAN shortOut = (BOOLEAN)((int)a->Data());
+    BOOLEAN shortOut = (BOOLEAN)((long)a->Data());
 #if HAVE_CAN_SHORT_OUT
     if (!shortOut)
@@ -255,5 +255,5 @@
       {
         intvec *iv1=new intvec(i+1);
-        (*iv1)[i]=(int)a->Data();
+        (*iv1)[i]=(int)((long)(a->Data()));
         intvec *ivn=ivAdd(iv,iv1);
         delete iv;
@@ -262,5 +262,5 @@
       }
       else
-        (*iv)[i]=(int)a->Data();
+        (*iv)[i]=(int)((long)(a->Data()));
     }
     else
@@ -273,5 +273,5 @@
       }
       else
-        IMATELEM(*iv,i+1,c) = (int)a->Data();
+        IMATELEM(*iv,i+1,c) = (int)((long)(a->Data()));
     }
   }
@@ -970,5 +970,5 @@
     if (hh->Typ() == INT_CMD)
     {
-      (*iv)[i++] = (int)(hh->Data());
+      (*iv)[i++] = (int)((long)(hh->Data()));
     }
     else if ((hh->Typ() == INTVEC_CMD)
Index: Singular/ipconv.cc
===================================================================
--- Singular/ipconv.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/ipconv.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: ipconv.cc,v 1.27 2005-05-18 15:59:35 Singular Exp $ */
+/* $Id: ipconv.cc,v 1.28 2005-07-27 15:47:57 Singular Exp $ */
 /*
 * ABSTRACT: automatic type conversions
@@ -37,5 +37,5 @@
 static void * iiI2P(void *data)
 {
-  poly p=pISet((int)data);
+  poly p=pISet((int)(long)data);
   return (void *)p;
 }
@@ -43,5 +43,5 @@
 static void * iiI2V(void *data)
 {
-  poly p=pISet((int)data);
+  poly p=pISet((int)(long)data);
   if (p!=NULL) pSetComp(p,1);
   return (void *)p;
@@ -51,5 +51,5 @@
 {
   ideal I=idInit(1,1);
-  I->m[0]=pISet((int)data);
+  I->m[0]=pISet((int)(long)data);
   return (void *)I;
 }
@@ -116,5 +116,6 @@
 static void * iiI2Iv(void *data)
 {
-  intvec *iv=new intvec((int)data,(int)data);
+  int s=(int)(long)data;
+  intvec *iv=new intvec(s,s);
   return (void *)iv;
 }
@@ -122,5 +123,5 @@
 static void * iiI2N(void *data)
 {
-  number n=nInit((int)data);
+  number n=nInit((int)(long)data);
   return (void *)n;
 }
Index: Singular/ipprint.cc
===================================================================
--- Singular/ipprint.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/ipprint.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: ipprint.cc,v 1.22 2005-05-18 15:59:35 Singular Exp $ */
+/* $Id: ipprint.cc,v 1.23 2005-07-27 15:47:57 Singular Exp $ */
 /*
 * ABSTRACT: interpreter: printing
@@ -263,5 +263,5 @@
   if ((u->next!=NULL)&&(u->Typ()==INT_CMD))
   {
-    print=((int)u->Data()>0);
+    print=  (((long)(u->Data()))>0L);
     u=u->next;
   }
@@ -286,5 +286,5 @@
 {
   int i,j;
-  int row_shift=(int)atGet(u,"rowShift",INT_CMD);
+  int row_shift=(int)((long)(atGet(u,"rowShift",INT_CMD)));
   intvec * betti=(intvec *)u->Data();
   // head line --------------------------------------------------------
Index: Singular/ipshell.cc
===================================================================
--- Singular/ipshell.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/ipshell.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: ipshell.cc,v 1.119 2005-07-26 17:04:44 Singular Exp $ */
+/* $Id: ipshell.cc,v 1.120 2005-07-27 15:47:57 Singular Exp $ */
 /*
 * ABSTRACT:
@@ -919,5 +919,5 @@
   r=liFindRes(l,&len,&typ0);
   if (r==NULL) return TRUE;
-  res->data=(char *)syBetti(r,len,&reg,weights,(int)v->Data());
+  res->data=(char *)syBetti(r,len,&reg,weights,(int)(long)v->Data());
   omFreeSize((ADDRESS)r,(len)*sizeof(ideal));
   atSet(res,omStrDup("rowShift"),(void*)add_row_shift,INT_CMD);
@@ -1734,6 +1734,6 @@
     Werror("invald coeff. field description, expecting precision list");
   lists LL=(lists)L->m[1].data;
-  int r1=(int)LL->m[0].data;
-  int r2=(int)LL->m[1].data;
+  int r1=(int)(long)LL->m[0].data;
+  int r2=(int)(long)LL->m[1].data;
   if ((r1<=SHORT_REAL_LENGTH)
   && (r2=SHORT_REAL_LENGTH))
@@ -1780,5 +1780,5 @@
   if (L->m[0].Typ()==INT_CMD)
   {
-    R->ch=(int)L->m[0].Data();
+    R->ch=(int)(long)L->m[0].Data();
   }
   else if (L->m[0].Typ()==LIST_CMD)
@@ -1897,5 +1897,5 @@
       intvec *iv;
       if (vv->m[1].Typ()==INT_CMD)
-        iv=new intvec((int)vv->m[1].Data(),(int)vv->m[1].Data());
+        iv=new intvec((int)(long)vv->m[1].Data(),(int)(long)vv->m[1].Data());
       else
         iv=ivCopy((intvec*)vv->m[1].Data()); //assume INTVEC
@@ -2043,6 +2043,6 @@
 BOOLEAN mpKoszul(leftv res,leftv c/*ip*/, leftv b/*in*/, leftv id)
 {
-  int n=(int)b->Data();
-  int d=(int)c->Data();
+  int n=(int)(long)b->Data();
+  int d=(int)(long)c->Data();
   int     k,l,sign,row,col;
   matrix  result;
@@ -2099,5 +2099,5 @@
 {
   syStrategy syzstr=(syStrategy)u->Data();
-  BOOLEAN minim=(int)w->Data();
+  BOOLEAN minim=(int)(long)w->Data();
   int row_shift=0;
   int add_row_shift=0;
@@ -2305,7 +2305,7 @@
 void spectrum::copy_deep( lists l )
 {
-    mu = (int)(l->m[0].Data( ));
-    pg = (int)(l->m[1].Data( ));
-    n  = (int)(l->m[2].Data( ));
+    mu = (int)(long)(l->m[0].Data( ));
+    pg = (int)(long)(l->m[1].Data( ));
+    n  = (int)(long)(l->m[2].Data( ));
 
     copy_new( n );
@@ -2913,7 +2913,7 @@
     // -------------------------
 
-    int     mu = (int)(l->m[0].Data( ));
-    int     pg = (int)(l->m[1].Data( ));
-    int     n  = (int)(l->m[2].Data( ));
+    int     mu = (int)(long)(l->m[0].Data( ));
+    int     pg = (int)(long)(l->m[1].Data( ));
+    int     n  = (int)(long)(l->m[2].Data( ));
 
     if( n <= 0 )
@@ -3007,5 +3007,5 @@
     }
 
-    if( mu != (int)(l->m[0].Data( )) )
+    if( mu != (int)(long)(l->m[0].Data( )) )
     {
         return  semicListMilnorWrong;
@@ -3024,5 +3024,5 @@
     }
 
-    if( pg != (int)(l->m[1].Data( )) )
+    if( pg != (int)(long)(l->m[1].Data( )) )
     {
         return  semicListPGWrong;
@@ -3091,5 +3091,5 @@
 
     lists   l = (lists)first->Data( );
-    int     k = (int)second->Data( );
+    int     k = (int)(long)second->Data( );
 
     if( (state=list_is_spectrum( l ))!=semicOK )
@@ -3126,5 +3126,5 @@
 {
   semicState  state;
-  BOOLEAN qh=(((int)w->Data())==1);
+  BOOLEAN qh=(((int)(long)w->Data())==1);
 
   // -----------------
@@ -3455,5 +3455,5 @@
     return TRUE;
   else
-    LP->m= (int)(v->Data());
+    LP->m= (int)(long)(v->Data());
 
   v= v->next;
@@ -3461,5 +3461,5 @@
     return TRUE;
   else
-    LP->n= (int)(v->Data());
+    LP->n= (int)(long)(v->Data());
 
   v= v->next;
@@ -3467,5 +3467,5 @@
     return TRUE;
   else
-    LP->m1= (int)(v->Data());
+    LP->m1= (int)(long)(v->Data());
 
   v= v->next;
@@ -3473,5 +3473,5 @@
     return TRUE;
   else
-    LP->m2= (int)(v->Data());
+    LP->m2= (int)(long)(v->Data());
 
   v= v->next;
@@ -3479,5 +3479,5 @@
     return TRUE;
   else
-    LP->m3= (int)(v->Data());
+    LP->m3= (int)(long)(v->Data());
 
 #ifdef mprDEBUG_PROT
@@ -3520,5 +3520,5 @@
 {
   ideal gls = (ideal)(arg1->Data());
-  int imtype= (int)arg2->Data();
+  int imtype= (int)(long)arg2->Data();
 
   uResultant::resMatType mtype= determineMType( imtype );
@@ -3545,5 +3545,5 @@
   poly gls;
   gls= (poly)(arg1->Data());
-  int howclean= (int)arg3->Data();
+  int howclean= (int)(long)arg3->Data();
 
   if ( !(rField_is_R() ||
@@ -3688,5 +3688,5 @@
   int n= IDELEMS( p );
   int m= IDELEMS( w );
-  int tdg= (int)arg3->Data();
+  int tdg= (int)(long)arg3->Data();
 
   res->data= (void*)NULL;
@@ -3790,5 +3790,5 @@
   if ( v->Typ() != INT_CMD )
     return TRUE;
-  else imtype= (int)v->Data();
+  else imtype= (int)(long)v->Data();
   v= v->next;
 
@@ -3806,5 +3806,5 @@
   if ( v->Typ() != INT_CMD )
     return TRUE;
-  else howclean= (int)v->Data();
+  else howclean= (int)(long)v->Data();
 
   uResultant::resMatType mtype= determineMType( imtype );
@@ -4302,5 +4302,5 @@
   if (pn->Typ()==INT_CMD)
   {
-    ch=(int)pn->Data();
+    ch=(int)(long)pn->Data();
   }
   else if ((pn->name != NULL)
@@ -4311,10 +4311,10 @@
     if ((pn->next!=NULL) && (pn->next->Typ()==INT_CMD))
     {
-      float_len=(int)pn->next->Data();
+      float_len=(int)(long)pn->next->Data();
       float_len2=float_len;
       pn=pn->next;
       if ((pn->next!=NULL) && (pn->next->Typ()==INT_CMD))
       {
-        float_len2=(int)pn->next->Data();
+        float_len2=(int)(long)pn->next->Data();
         pn=pn->next;
       }
Index: Singular/lists.cc
===================================================================
--- Singular/lists.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/lists.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: lists.cc,v 1.29 2005-07-22 16:22:11 levandov Exp $ */
+/* $Id: lists.cc,v 1.30 2005-07-27 15:47:57 Singular Exp $ */
 /*
 * ABSTRACT: handling of the list type
@@ -124,9 +124,9 @@
 {
   lists ul=(lists)u->CopyD();
-  res->data=(char *)lInsert0(ul,v,(int)w->Data());
+  res->data=(char *)lInsert0(ul,v,(int)(long)w->Data());
   if (res->data==NULL)
   {
     Werror("cannot insert type `%s` at pos. %d",
-      Tok2Cmdname(v->Typ()),(int)w->Data());
+      Tok2Cmdname(v->Typ()),(int)(long)w->Data());
     return TRUE;
   }
@@ -150,5 +150,5 @@
 {
   lists ul=(lists)u->Data();
-  int VIndex=(int)v->Data()-1;
+  int VIndex=(int)(long)v->Data()-1;
 
   if((0<=VIndex)&&(VIndex<=ul->nr))
Index: Singular/pcv.cc
===================================================================
--- Singular/pcv.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/pcv.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR      *
 *****************************************/
-/* $Id: pcv.cc,v 1.34 2001-11-14 16:41:02 Singular Exp $ */
+/* $Id: pcv.cc,v 1.35 2005-07-27 15:47:58 Singular Exp $ */
 /*
 * ABSTRACT: conversion between polys and coef vectors
@@ -330,9 +330,9 @@
       if(h&&h->Typ()==INT_CMD)
       {
-        int d0=(int)h->Data();
+        int d0=(int)(long)h->Data();
         h=h->next;
         if(h&&h->Typ()==INT_CMD)
         {
-          int d1=(int)h->Data();
+          int d1=(int)(long)h->Data();
           res->rtyp=LIST_CMD;
           res->data=(void*)pcvP2CV(p,d0,d1);
@@ -358,9 +358,9 @@
       if(h&&h->Typ()==INT_CMD)
       {
-        int d0=(int)h->Data();
+        int d0=(int)(long)h->Data();
         h=h->next;
         if(h&&h->Typ()==INT_CMD)
         {
-          int d1=(int)h->Data();
+          int d1=(int)(long)h->Data();
           res->rtyp=LIST_CMD;
           res->data=(void*)pcvCV2P(pl,d0,d1);
@@ -392,9 +392,9 @@
     if(h&&h->Typ()==INT_CMD)
     {
-      int d0=(int)h->Data();
+      int d0=(int)(long)h->Data();
       h=h->next;
       if(h&&h->Typ()==INT_CMD)
       {
-        int d1=(int)h->Data();
+        int d1=(int)(long)h->Data();
         res->rtyp=INT_CMD;
         res->data=(void*)pcvDim(d0,d1);
@@ -448,9 +448,9 @@
     if(h&&h->Typ()==INT_CMD)
     {
-      int d0=(int)h->Data();
+      int d0=(int)(long)h->Data();
       h=h->next;
       if(h&&h->Typ()==INT_CMD)
       {
-        int d1=(int)h->Data();
+        int d1=(int)(long)h->Data();
         res->rtyp=LIST_CMD;
         res->data=(void*)pcvBasis(d0,d1);
Index: Singular/subexpr.cc
===================================================================
--- Singular/subexpr.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ Singular/subexpr.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -5,5 +5,5 @@
 * ABSTRACT: handling of leftv
 */
-/* $Id: subexpr.cc,v 1.90 2005-05-31 07:42:21 bricken Exp $ */
+/* $Id: subexpr.cc,v 1.91 2005-07-27 15:47:58 Singular Exp $ */
 
 #include <stdlib.h>
@@ -144,5 +144,5 @@
           break;
        case INT_CMD:
-          ::Print("%-*.*s%d",spaces,spaces," ",(int)d);
+          ::Print("%-*.*s%d",spaces,spaces," ",(int)(long)d);
           break;
        case PROC_CMD:
@@ -662,10 +662,10 @@
           {
             s=(char *)omAlloc(MAX_INT_LEN+7);
-            sprintf(s,"int(%d)",(int)d);
+            sprintf(s,"int(%d)",(int)(long)d);
           }
           else
           {
             s=(char *)omAlloc(MAX_INT_LEN+2);
-            sprintf(s,"%d",(int)d);
+            sprintf(s,"%d",(int)(long)d);
           }
           return s;
Index: kernel/clapconv.cc
===================================================================
--- kernel/clapconv.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/clapconv.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -3,5 +3,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-// $Id: clapconv.cc,v 1.5 2005-06-13 16:23:30 Singular Exp $
+// $Id: clapconv.cc,v 1.6 2005-07-27 15:48:28 Singular Exp $
 /*
 * ABSTRACT: convert data between Singular and factory
@@ -48,7 +48,7 @@
   else
   {
-    if ( ((int)n) & 1 )
-    {
-      term = ((int)n) >>2;
+    if ( ((long)n) & 1L )
+    {
+      term = ((long)n) >>2;
     }
     else
@@ -119,7 +119,7 @@
     else
     {
-      if ( (int)(pGetCoeff( p )) & 1 )
-      {
-        term = ((int)( pGetCoeff( p ) )>>2);
+      if ( (long)(pGetCoeff( p )) & 1 )
+      {
+        term = ((long)( pGetCoeff( p ) )>>2);
       }
       else
@@ -324,5 +324,5 @@
       //&&  ( napGetCoeff( p )->s == 0))
       //  naNormalize( naGetCoeff( p ) );
-      if ( (int)(napGetCoeff( p )) & 1 )
+      if ( (long)(napGetCoeff( p )) & 1L )
         term = nlInt( napGetCoeff( p ) );
       else
@@ -543,5 +543,5 @@
       //&&  ( napGetCoeff( p )->s == 0))
       //  naNormalize( naGetCoeff( p ) );
-      if ( (int)(napGetCoeff( p )) & SR_INT )
+      if ( (long)(napGetCoeff( p )) & SR_INT )
         term = nlInt( napGetCoeff( p ) );
         //term = SR_TO_INT(napGetCoeff( p )) ;
Index: kernel/fast_maps.cc
===================================================================
--- kernel/fast_maps.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/fast_maps.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -7,5 +7,5 @@
  *  Author:  obachman (Olaf Bachmann)
  *  Created: 02/01
- *  Version: $Id: fast_maps.cc,v 1.3 2005-04-25 12:59:13 Singular Exp $
+ *  Version: $Id: fast_maps.cc,v 1.4 2005-07-27 15:48:28 Singular Exp $
  *******************************************************************/
 #include "mod2.h"
@@ -102,8 +102,8 @@
     p_wrp(monomial->dest, dest_r);
   }
-  if (monomial->f1!=NULL) { printf(" f1:%x", (unsigned int)monomial->f1->src);
+  if (monomial->f1!=NULL) { printf(" f1:%x", (long)monomial->f1->src);
                             // p_wrp(monomial->f1->src, src_r);
                           }
-  if (monomial->f2!=NULL) { printf(" f2:%x",(unsigned int)monomial->f2->src);
+  if (monomial->f2!=NULL) { printf(" f2:%x",(long)monomial->f2->src);
                             // p_wrp(monomial->f2->src, src_r);
                           }
Index: kernel/feOpt.h
===================================================================
--- kernel/feOpt.h	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/feOpt.h	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: feOpt.h,v 1.1.1.1 2003-10-06 12:15:51 Singular Exp $ */
+/* $Id: feOpt.h,v 1.2 2005-07-27 15:48:28 Singular Exp $ */
 /*
 * ABSTRACT: Declarations for working with Options
@@ -60,5 +60,5 @@
   if (opt != FE_OPT_UNDEF && feOptSpec[(int)opt].type != feOptString)
   {
-    *val = (int) feOptSpec[(int)opt].value;
+    *val = (int) ((long)(feOptSpec[(int)opt].value));
     return TRUE;
   }
Index: kernel/ffields.cc
===================================================================
--- kernel/ffields.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/ffields.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: ffields.cc,v 1.2 2005-07-27 09:46:20 Singular Exp $ */
+/* $Id: ffields.cc,v 1.3 2005-07-27 15:48:28 Singular Exp $ */
 /*
 * ABSTRACT: finite fields with a none-prime number of elements (via tables)
@@ -123,7 +123,7 @@
 BOOLEAN nfDBTest (number a, char *f, int l)
 {
-  if (((int)a<0) || ((int)a>nfCharQ))
-  {
-    Print("wrong %d in %s:%d\n",(int)a,f,l);
+  if (((long)a<0L) || ((long)a>(long)nfCharQ))
+  {
+    Print("wrong %d in %s:%d\n",(int)((long)a),f,l);
     return FALSE;
   }
@@ -163,8 +163,8 @@
   nfTest(b);
 #endif
-  if (((int)a == nfCharQ) || ((int)b == nfCharQ))
+  if (((long)a == (long)nfCharQ) || ((long)b == (long)nfCharQ))
     return (number)nfCharQ;
   /*else*/
-  int i=(int)a+(int)b;
+  int i=(int)((long)a+(long)b);
   if (i>=nfCharQ1) i-=nfCharQ1;
 #ifdef LDEBUG
@@ -213,6 +213,6 @@
   nfTest(n);
 #endif
-  if(nfCharQ == (int)n) return -1;
-  return (int)n;
+  if((long)nfCharQ == (long)n) return -1;
+  return (int)((long)n);
 }
 
@@ -236,25 +236,25 @@
   nfTest(b);
 #endif
-  if (nfCharQ == (int)a) return b;
-  if (nfCharQ == (int)b) return a;
-  int zb,zab,r;
-  if ((int)a >= (int)b)
-  {
-    zb = (int)b;
-    zab = (int)a-(int)b;
+  if ((long)nfCharQ == (long)a) return b;
+  if ((long)nfCharQ == (long)b) return a;
+  long zb,zab,r;
+  if ((long)a >= (long)b)
+  {
+    zb = (long)b;
+    zab = (long)a-(long)b;
   }
   else
   {
-    zb = (int)a;
-    zab = (int)b-(int)a;
+    zb = (long)a;
+    zab = (long)b-(long)a;
   }
 #ifdef LDEBUG
   nfTest((number)zab);
 #endif
-  if (nfPlus1Table[zab]==nfCharQ) r=nfCharQ; /*if z^(a-b)+1 =0*/
+  if (nfPlus1Table[zab]==nfCharQ) r=(long)nfCharQ; /*if z^(a-b)+1 =0*/
   else
   {
-    r= zb+nfPlus1Table[zab];
-    if(r>=nfCharQ1) r-=nfCharQ1;
+    r= zb+(long)nfPlus1Table[zab];
+    if(r>=(long)nfCharQ1) r-=(long)nfCharQ1;
   }
 #ifdef LDEBUG
@@ -281,5 +281,5 @@
   nfTest(a);
 #endif
-  return nfCharQ == (int)a;
+  return (long)nfCharQ == (long)a;
 }
 
@@ -292,5 +292,5 @@
   nfTest(a);
 #endif
-  return 0 == (int)a;
+  return 0L == (long)a;
 }
 
@@ -303,6 +303,6 @@
   nfTest(a);
 #endif
-  if (0 == (int)a) return FALSE; /* special handling of char 2*/
-  return nfM1 == (int)a;
+  if (0L == (long)a) return FALSE; /* special handling of char 2*/
+  return (long)nfM1 == (long)a;
 }
 
@@ -315,18 +315,18 @@
   nfTest(b);
 #endif
-  if ((int)b==nfCharQ)
+  if ((long)b==(long)nfCharQ)
   {
     WerrorS("div. by 0");
-    return (number)nfCharQ;
-  }
-#ifdef LDEBUG
-  nfTest(a);
-#endif
-  if ((int)a==nfCharQ)
-    return (number)nfCharQ;
+    return (number)((long)nfCharQ);
+  }
+#ifdef LDEBUG
+  nfTest(a);
+#endif
+  if ((long)a==(long)nfCharQ)
+    return (number)((long)nfCharQ);
   /*else*/
-  int s = (int)a - (int)b;
-  if (s < 0)
-    s += nfCharQ1;
+  long s = (long)a - (long)b;
+  if (s < 0L)
+    s += (long)nfCharQ1;
 #ifdef LDEBUG
   nfTest((number)s);
@@ -343,13 +343,13 @@
   nfTest(c);
 #endif
-  if ((int)c==nfCharQ)
+  if ((long)c==(long)nfCharQ)
   {
     WerrorS("div. 1/0");
-    return (number)nfCharQ;
-  }
-#ifdef LDEBUG
-  nfTest(((number)(nfCharQ1-(int)c)));
-#endif
-  return (number)(nfCharQ1-(int)c);
+    return (number)((long)nfCharQ);
+  }
+#ifdef LDEBUG
+  nfTest(((number)((long)nfCharQ1-(long)c)));
+#endif
+  return (number)((long)nfCharQ1-(long)c);
 }
 
@@ -363,7 +363,7 @@
   nfTest(c);
 #endif
-  if (nfCharQ == (int)c) return c;
-  int i=(int)c+nfM1;
-  if (i>=nfCharQ1) i-=nfCharQ1;
+  if ((long)nfCharQ == (long)c) return c;
+  long i=(long)c+(long)nfM1;
+  if (i>=(long)nfCharQ1) i-=(long)nfCharQ1;
 #ifdef LDEBUG
   nfTest((number)i);
@@ -381,5 +381,5 @@
   nfTest(b);
 #endif
-  return (int)a != (int)b;
+  return (long)a != (long)b;
 }
 
@@ -393,5 +393,5 @@
   nfTest(b);
 #endif
-  return (int)a == (int)b;
+  return (long)a == (long)b;
 }
 
@@ -404,14 +404,14 @@
   nfTest(a);
 #endif
-  if ((int)a==nfCharQ)  StringAppendS("0");
-  else if ((int)a==0)   StringAppendS("1");
+  if ((long)a==(long)nfCharQ)  StringAppendS("0");
+  else if ((long)a==0L)   StringAppendS("1");
   else if (nfIsMOne(a))   StringAppendS("-1");
   else
   {
     StringAppendS(nfParameter);
-    if ((int)a!=1)
+    if ((long)a!=1L)
     {
       if(currRing->ShortOut==0)  StringAppendS("^");
-      StringAppend("%d",(int)a);
+      StringAppend("%d",(int)((long)a));
     }
   }
@@ -427,6 +427,6 @@
 #endif
   char *s;
-  if (((int)a==nfCharQ) || ((int)a==0)) return NULL;
-  else if ((int)a==1)
+  if (((long)a==(long)nfCharQ) || ((long)a==0L)) return NULL;
+  else if ((long)a==1L)
   {
     return omStrDup(nfParameter);
@@ -435,5 +435,5 @@
   {
     s=(char *)omAlloc(4+strlen(nfParameter));
-    sprintf(s,"%s%d",nfParameter,(int)a);
+    sprintf(s,"%s%d",nfParameter,(int)((long)a));
   }
   return s;
@@ -450,5 +450,5 @@
   {
     //*result=nfInit(1);
-    *result = (number)0;
+    *result = (number)0L;
   }
   else if (i==1)
@@ -688,5 +688,5 @@
 number nfMapP(number c)
 {
-  return nfInit((int)c);
+  return nfInit((int)((long)c));
 }
 
Index: kernel/gr_kstd2.cc
===================================================================
--- kernel/gr_kstd2.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/gr_kstd2.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: gr_kstd2.cc,v 1.7 2005-03-17 14:15:40 Singular Exp $ */
+/* $Id: gr_kstd2.cc,v 1.8 2005-07-27 15:48:28 Singular Exp $ */
 /*
 *  ABSTRACT -  Kernel: noncomm. alg. of Buchberger
@@ -944,5 +944,5 @@
 /*   extern int zaehler; */
 /*   Print("Total pairs considered:%d\n",zaehler); zaehler=0; */
-#endif PDEBUG
+#endif /*PDEBUG*/
   return (strat->Shdl);
 }
Index: kernel/longalg.cc
===================================================================
--- kernel/longalg.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/longalg.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: longalg.cc,v 1.10 2005-06-08 13:52:12 Singular Exp $ */
+/* $Id: longalg.cc,v 1.11 2005-07-27 15:48:28 Singular Exp $ */
 /*
 * ABSTRACT:   algebraic numbers
@@ -1988,5 +1988,5 @@
   l->s=2;
   l->z=(napoly)p_Init(nacRing);
-  int i=(int)c;
+  int i=(int)((long)c);
   if (i>(naPrimeM>>2)) i-=naPrimeM;
   napGetCoeff(l->z)=nlInit(i);
@@ -2029,5 +2029,5 @@
 {
   if (npIsZero(c)) return NULL;
-  int i=(int)c;
+  int i=(int)((long)c);
   if (i>naPrimeM) i-=naPrimeM;
   number n=npInit(i);
Index: kernel/longrat.cc
===================================================================
--- kernel/longrat.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/longrat.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: longrat.cc,v 1.5 2004-09-14 10:27:20 Singular Exp $ */
+/* $Id: longrat.cc,v 1.6 2005-07-27 15:48:28 Singular Exp $ */
 /*
 * ABSTRACT: computation with long rational numbers (Hubert Grassmann)
@@ -157,14 +157,14 @@
   }
   //if ((int)a==1) Print("!! 0x1 as number ? %s %d\n",f,l);
-  if ((((int)a)&3)==3)
+  if ((((long)a)&3L)==3L)
   {
     Print(" !!longrat:ptr(3) in %s:%d\n",f,l);
     return FALSE;
   }
-  if ((((int)a)&3)==1)
-  {
-    if (((((int)a)<<1)>>1)!=((int)a))
-    {
-      Print(" !!longrat:arith:%x in %s:%d\n",(int)a, f,l);
+  if ((((long)a)&3L)==1L)
+  {
+    if (((((long)a)<<1)>>1)!=((long)a))
+    {
+      Print(" !!longrat:arith:%x in %s:%d\n",(long)a, f,l);
       return FALSE;
     }
@@ -475,5 +475,5 @@
 #endif
     n->s=1;
-    if ((int)a>0)
+    if ((long)a>0L)
     {
       mpz_init_set_si(&n->z,(long)1);
@@ -761,7 +761,7 @@
   if (SR_HDL(a) & SR_HDL(b) & SR_INT)
   {
-    if ((int)a>0)
-    {
-      if ((int)b>0)
+    if ((long)a>0L)
+    {
+      if ((long)b>0L)
         return INT_TO_SR(SR_TO_INT(a)%SR_TO_INT(b));
       else
@@ -770,5 +770,5 @@
     else
     {
-      if ((int)b>0)
+      if ((long)b>0L)
       {
         int i=(-SR_TO_INT(a))%SR_TO_INT(b);
@@ -787,5 +787,5 @@
   {
     /* a is a small and b is a large int: -> a or (a+b) or (a-b) */
-    if ((int)a<0)
+    if ((long)a<0L)
     {
       if (mpz_isNeg(&b->z))
@@ -907,5 +907,5 @@
       {
         mpz_init_set(&u->n,&a->n);
-        if ((int)b>0)
+        if ((long)b>0L)
           mpz_mul_ui(&u->n,&u->n,SR_TO_INT(b));
         else
@@ -1293,9 +1293,9 @@
     return i%p;
   }
-  int iz=mpz_mmod_ui(NULL,&n->z,(unsigned long)p);
+  int iz=(int)mpz_mmod_ui(NULL,&n->z,(unsigned long)p);
   if (n->s!=3)
   {
     int in=mpz_mmod_ui(NULL,&n->n,(unsigned long)p);
-    return (int)npDiv((number)iz,(number)in);
+    return (int)((long)npDiv((number)iz,(number)in));
   }
   return iz;
@@ -1396,7 +1396,7 @@
     if (b->s!=0)
       return FALSE;
-    if (((int)a > 0) && (mpz_isNeg(&b->z)))
+    if (((long)a > 0L) && (mpz_isNeg(&b->z)))
       return FALSE;
-    if (((int)a < 0) && (!mpz_isNeg(&b->z)))
+    if (((long)a < 0L) && (!mpz_isNeg(&b->z)))
       return FALSE;
     MP_INT  bb;
@@ -1537,5 +1537,5 @@
       case 3:
       {
-        if ((int)a>0)
+        if ((long)a>0L)
           mpz_add_ui(&u->z,&b->z,SR_TO_INT(a));
         else
@@ -1728,5 +1728,5 @@
       case 3:
       {
-        if ((int)a>0)
+        if ((long)a>0L)
         {
           mpz_sub_ui(&u->z,&b->z,SR_TO_INT(a));
@@ -1790,5 +1790,5 @@
       case 3:
       {
-        if ((int)b>0)
+        if ((long)b>0L)
         {
           mpz_sub_ui(&u->z,&a->z,SR_TO_INT(b));
@@ -1984,5 +1984,5 @@
     u->s=b->s;
     if (u->s==1) u->s=0;
-    if ((int)a>0)
+    if ((long)a>0L)
     {
       mpz_mul_ui(&u->z,&b->z,(unsigned long)SR_TO_INT(a));
Index: kernel/longrat.h
===================================================================
--- kernel/longrat.h	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/longrat.h	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: longrat.h,v 1.1.1.1 2003-10-06 12:15:57 Singular Exp $ */
+/* $Id: longrat.h,v 1.2 2005-07-27 15:48:29 Singular Exp $ */
 /*
 * ABSTRACT: computation with long rational numbers
@@ -14,5 +14,5 @@
 typedef MP_INT lint;
 
-#define SR_INT    1
+#define SR_INT    1L
 #define INT_TO_SR(INT)  ((number) (((long)INT << 2) + SR_INT))
 #define SR_TO_INT(SR)   (((long)SR) >> 2)
Index: kernel/modulop.cc
===================================================================
--- kernel/modulop.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/modulop.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: modulop.cc,v 1.4 2005-07-05 17:10:41 Singular Exp $ */
+/* $Id: modulop.cc,v 1.5 2005-07-27 15:48:29 Singular Exp $ */
 /*
 * ABSTRACT: numbers modulo p (<=32003)
@@ -36,5 +36,5 @@
 BOOLEAN npGreaterZero (number k)
 {
-  int h = (int) k;
+  int h = (int)((long) k);
   return ((int)h !=0) && (h <= (npPrimeM>>1));
 }
@@ -73,5 +73,5 @@
 {
   if ((long)n > (npPrimeM >>1)) return (int)((long)n -npPrimeM);
-  else                          return (int)n;
+  else                          return (int)((long)n);
 }
 
@@ -235,5 +235,5 @@
 {
   if ((long)a > (npPrimeM >>1)) StringAppend("-%d",(int)(npPrimeM-((long)a)));
-  else                          StringAppend("%d",(int)a);
+  else                          StringAppend("%d",(int)((long)a));
 }
 
@@ -435,5 +435,6 @@
   lint *dest,*ndest;
   int size,i;
-  int e,al,bl,iz,in;
+  int e,al,bl,in;
+  long iz;
   mp_ptr qp,dd,nn;
 
@@ -494,5 +495,5 @@
   omFreeBin((ADDRESS)res, rnumber_bin);
   if(res->s==0)
-    iz=(int)npDiv((number)iz,(number)in);
+    iz=(long)npDiv((number)iz,(number)in);
   return (number)iz;
 }
Index: kernel/mpr_complex.cc
===================================================================
--- kernel/mpr_complex.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/mpr_complex.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_complex.cc,v 1.2 2005-02-03 16:43:37 Singular Exp $ */
+/* $Id: mpr_complex.cc,v 1.3 2005-07-27 15:48:29 Singular Exp $ */
 
 /*
@@ -27,5 +27,4 @@
 // Make sure that it is up to date!!
 #define SR_HDL(A) ((long)(A))
-#define SR_INT    1
 #define SR_TO_INT(SR) (((long)SR) >> 2)
 
Index: kernel/shortfl.cc
===================================================================
--- kernel/shortfl.cc	(revision 7adb161bdb6d1b153d8380ad71f162acf6914d8f)
+++ kernel/shortfl.cc	(revision 7447d816c8405ab9d5fa1e0a163879b46e30923c)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: shortfl.cc,v 1.1.1.1 2003-10-06 12:16:03 Singular Exp $ */
+/* $Id: shortfl.cc,v 1.2 2005-07-27 15:48:29 Singular Exp $ */
 
 /*
@@ -407,5 +407,5 @@
 static number nrMapP(number from)
 {
-  int i = (int)from;
+  int i = (int)((long)from);
   float r = (float)i;
   return nf(r).N();
