Changeset 80


Ignore:
Timestamp:
Mar 24, 2009 6:26:09 PM (11 years ago)
Author:
pbelotti
Message:

trying again compatibility with MSVC

Location:
trunk/Couenne/src/readnl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/readnl/invmap.cpp

    r79 r80  
    1616#include "r_opn.hd"
    1717
    18 #if defined(_MSC_VER)
    19 typedef void * fcn_ptr;
    20 #else
    21 typedef long int fcn_ptr;
    22 #endif
    23 
     18//#define Intcast (int)(long)
    2419
    2520/* couples an ASL function pointer with the relative operator constant */
     
    3934  /* FIX! weak cast for 64 bit machines */
    4035
    41   register fcn_ptr f1 = (fcn_ptr) (((AslCouPair *) p1) -> fp);
    42   register fcn_ptr f2 = (fcn_ptr) (((AslCouPair *) p2) -> fp);
     36  register int f1 = Intcast (((AslCouPair *) p1) -> fp);
     37  register int f2 = Intcast (((AslCouPair *) p2) -> fp);
    4338
    4439  if      (f1 < f2) return -1;
     
    6257  /* FIX cast fo 64 bit machines */
    6358
    64   if (((fcn_ptr) f <  N_OPS) &&
    65       ((fcn_ptr) f > -N_OPS))
    66     return (fcn_ptr) f;
     59  if ((Intcast f <  N_OPS) &&
     60      (Intcast f > -N_OPS))
     61    return Intcast f;
    6762
    6863  key.fp = f;
  • trunk/Couenne/src/readnl/nl2e.cpp

    r79 r80  
    138138
    139139  default:
    140     printf ("ERROR: unknown operator (address %p), aborting.\n", e -> op);
     140    printf ("ERROR: unknown operator (address %p), aborting.\n", Intcast (e -> op));
    141141    exit (-1);
    142142    //return new exprConst (0);
  • trunk/Couenne/src/readnl/readnl.cpp

    r79 r80  
    2222#include "opcode.hd"
    2323
    24 #if defined(_MSC_VER)
    25 typedef void * fcn_ptr;
    26 #else
    27 typedef long int fcn_ptr;
    28 #endif
    29 
    3024#define OBJ_DE    ((const ASL_fg *) asl) -> I.obj_de_
    3125#define VAR_E     ((const ASL_fg *) asl) -> I.var_e_
     
    3731// check if an expression is a null pointer or equals zero
    3832inline bool is_expr_zero (expr* e)
    39   {return ((e==NULL) || (((((fcn_ptr) e->op) == OPNUM) &&
     33{return ((e==NULL) || ((((Intcast (e->op)) == OPNUM) &&
    4034                          (fabs (((expr_n *)e) -> v)  < COUENNE_EPS)
    4135                          //  && (fabs (e -> dL) < COUENNE_EPS)
Note: See TracChangeset for help on using the changeset viewer.