Changeset 81


Ignore:
Timestamp:
Mar 24, 2009 7:12:27 PM (11 years ago)
Author:
pbelotti
Message:

merged changes from Couenne-trunk:80 (fix casts for AMPL function pointers)

Location:
stable/0.1/Couenne/src/readnl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable/0.1/Couenne/src/readnl/invmap.cpp

    r1 r81  
    1616#include "r_opn.hd"
    1717
    18 
    1918/* couples an ASL function pointer with the relative operator constant */
    2019
     
    3332  /* FIX! weak cast for 64 bit machines */
    3433
    35   register long int f1 = (long int) (((AslCouPair *) p1) -> fp);
    36   register long int f2 = (long int) (((AslCouPair *) p2) -> fp);
     34  register int f1 = Intcast (((AslCouPair *) p1) -> fp);
     35  register int f2 = Intcast (((AslCouPair *) p2) -> fp);
    3736
    3837  if      (f1 < f2) return -1;
     
    5655  /* FIX cast fo 64 bit machines */
    5756
    58   if (((long int) f <  N_OPS) &&
    59       ((long int) f > -N_OPS))
    60     return (long int) f;
     57  if ((Intcast f <  N_OPS) &&
     58      (Intcast f > -N_OPS))
     59    return Intcast f;
    6160
    6261  key.fp = f;
  • stable/0.1/Couenne/src/readnl/nl2e.cpp

    r1 r81  
    133133
    134134  default:
    135     printf ("ERROR: unknown operator (address %x), aborting.\n", (long int) e -> op);
     135    printf ("ERROR: unknown operator (address %p), aborting.\n", Intcast (e -> op));
    136136    exit (-1);
    137137    //return new exprConst (0);
  • stable/0.1/Couenne/src/readnl/readnl.cpp

    r1 r81  
    3131// check if an expression is a null pointer or equals zero
    3232inline bool is_expr_zero (expr* e)
    33   {return ((e==NULL) || (((((long int) e->op) == OPNUM) &&
     33{return ((e==NULL) || ((((Intcast (e->op)) == OPNUM) &&
    3434                          (fabs (((expr_n *)e) -> v)  < COUENNE_EPS)
    3535                          //  && (fabs (e -> dL) < COUENNE_EPS)
Note: See TracChangeset for help on using the changeset viewer.