Kdevelop chokes on this file

Charles Boivin okeo at mindless.com
Thu Jul 15 21:26:12 BST 1999


Hi everyone,

When I try to include the file attached with this message in a Qt
project, KDevelop chokes (i.e. it stays there, and does nothing). 

I believe this would happen even for a non-Qt project, but I haven't
tried it. 

I use Kdevelop's snapshot from 1999-07-12.


-- 
Charles Boivin

Graduate Student, Mechanical Engineering
University of British Columbia
Vancouver, BC, Canada
-------------- next part --------------
#include "GR_config.h"

#ifdef dim2
#define NUM_DIR 2
#define NUM_VERT 3
#define SM_MAX_NUM_NEIGH 50
#endif

#ifdef dim3
#define NUM_DIR 3
#define NUM_VERT 4
#define SM_MAX_NUM_NEIGH 150
#endif

#define XDIR 0
#define YDIR 1
#define ZDIR 2

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#if defined(PARCH_sun4) && !defined(__cplusplus) && defined(_Gnu_)
    extern int  open(const char *, int, ...);
    extern int  creat(const char *, unsigned short);
    /* extern int  read(int, void *, unsigned int); */
    /* extern int  write(int, const void *, unsigned int); */
    extern int  close(int);
#endif

#ifdef VERBOSE
#define DEBUG_PRINT(a) a
#else
#define DEBUG_PRINT(a)
#endif

#ifdef LOCALTEST
#define MATLAB_ON(a) a
#else
#define MATLAB_ON(a)
#endif
#define MATLAB_OFF

#ifdef SM_ASSERT
#define SM_ASSERT_ON(a) a
#else
#define SM_ASSERT_ON(a)
#endif
#define SM_ASSERT_OFF

#ifdef SM_STATS
#define STATS_ON(a) a
#else
#define STATS_ON(a)
#endif
#define STATS_OFF

/* if maximizing the min value */
#ifdef SM_MAXIMIZING
#define SM_MAXIMIZE(a) a
#else
#define SM_MAXIMIZE(a)
#endif

#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif

#define MAX_MIN_ANGLE 6
#define MIN_MAX_COSINE 7
#define MAX_MIN_COSINE 8
#define MAX_MIN_SINE 9
#define MIN_MAX_ANGLE 10

#define MAX_MIN_DIHEDRAL 1
#define MIN_MAX_DIHEDRAL 2
#define MAX_MIN_COSINE_DIHEDRAL 3
#define MIN_MAX_COSINE_DIHEDRAL 4
#define MAX_SINE_DIHEDRAL 5

#ifdef dim2
#define MAX_G_NUM         40
#endif
#ifdef dim3
#define MAX_G_NUM         150
#endif

#define CCW               1
#define CW                0
#define A_BIG_POS_NUMBER  1E300
#define A_BIG_NEG_NUMBER -1E300
#define MAX_SM_ITER       20
#define MAX_SM_INTS       50
#define END_PT_TOL           1E-10
#define SINGULAR_SYSTEM_TEST 1E-14
#define MACHINE_EPS          1E-15
#define LESS_THAN_MACHINE_EPS(x)   ( ((fabs(x)+1.0) > 1.0) ? 0 : 1 )
#define INIT_MIN_VALUE       1E300

/* new initial point constants */
#define NONE            -1 
#define CENTROID         1

/* smoothing techniques */
#define LAPLACE_ONLY      0
#define OPTIMIZATION_ONLY 1
#define COMBINED          2
#define COMBINED1         3
#define COMBINED2         4
#define COMBINED3         5
#define FLOATING_THRESHOLD 6
#define DEFAULT          -1
#define DEFAULT_LAP_ACCEPT -1

/* optimization step constants */
#define STEP_DONE        101
#define STEP_NOT_DONE    102

/* optimization termination constants */
#define STEP_ACCEPTED    100
#define IMP_TOO_SMALL    101
#define FLAT_NO_IMP      102
#define STEP_TOO_SMALL   103
#define EQUILIBRIUM       104
#define ZERO_SEARCH       105
#define MAX_ITER_EXCEEDED 106
#define LAP_ENOUGH        107

#define MIN_IMP          .001

#define SM_PSISROOT(procinfo) ((procinfo->myid == 0) ? 1 : 0)

#include "SMdata_structs.h"

#define      MEM_ERROR -25

#ifndef MY_MALLOC
/* Even if the standard malloc isn't used, whatever IS used must use the
   same call sequence, so this inclusion is okay. */
#include <stdlib.h>
#define MY_MALLOC(a,b,c,d) { \
if (c == 0) { \
    a = NULL; \
} else { \
    a = b malloc(c); \
} \
}
#endif
#ifndef MY_MALLOCN
#define MY_MALLOCN(a,b,c,d) { \
if (c == 0) { \
    a = NULL; \
} else { \
    a = b malloc(c); \
} \
}
#endif
#ifndef MY_FREE
#define MY_FREE(a) \
{ \
    if (a != NULL) free(a); \
}
#endif
#ifndef MY_FREEN
#define MY_FREEN(a) \
{  \
    if (a != NULL) free(a); \
}
#endif

#ifndef MAX
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif

#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif

#define INIT_LIST(a) \
{ \
  (a)->ptr = NULL; \
}

#define GET_NEXT_LIST_ITEM(list,data) \
{ \
  ADV_LIST(list); \
  data = (list)->ptr; \
}	

#define PRINT_ORDERED_PTS(local_mesh) \
{ \
  int i99,j99; \
  for (i99=0;i99<NUM_DIR;i99++) \
      printf(" free_vtx[%d] = %f; ",i99,local_mesh->free_vtx[i99]); \
  printf("\n"); \
  for (i99=0;i99<local_mesh->num_incident_vtx;i99++) { \
      for (j99=0;j99<NUM_DIR;j99++) \
          printf(" vtx_list[%d][%d]= %f;",i99,j99,local_mesh->incident_vtx[i99][j99]); \
      printf("\n"); \
  } \
}

#define WRITE_ORDERED_PTS(fp,local_mesh) \
{ \
  int i99,j99; \
  fprintf(fp,"%d  %d\n",local_mesh->num_incident_vtx, local_mesh->num_tri);\
  for (i99=0;i99<NUM_DIR;i99++) \
      fprintf(fp,"%f  ",local_mesh->free_vtx[i99]); \
  fprintf(fp,"\n"); \
  for (i99=0;i99<local_mesh->num_incident_vtx;i99++) { \
      for (j99=0;j99<NUM_DIR;j99++) \
          fprintf(fp,"%f  ",local_mesh->incident_vtx[i99][j99]); \
      fprintf(fp,"\n"); \
  } \
  for (i99=0;i99<local_mesh->num_tri;i99++) { \
      for (j99=0;j99<NUM_DIR;j99++) \
          fprintf(fp,"%d  ",local_mesh->vtx_connectivity[i99][j99]); \
      fprintf(fp,"\n"); \
  } \
}
#define WRITE_BINARY_ORDERED_PTS(local_mesh) \
{ \
  int i99,j99; \
  int fd99; \
  char filename99[128]; \
  double temp99; \
  sprintf(filename99,"test.data"); \
  if ((fd99 = creat(filename99, \
		    (unsigned short)(00644))) == -1) { \
     printf("cannot create filename for writing\n"); \
     exit(0); \
  } \
  temp99 = (double) local_mesh->num_incident_vtx; \
  write(fd99,&temp99,sizeof(double)); \
  temp99 = (double) local_mesh->num_tri;\
  write(fd99,&temp99,sizeof(double)); \
  for (i99=0;i99<NUM_DIR;i99++) {\
      temp99 = local_mesh->original_pt[i99]; \
      write(fd99,&temp99,sizeof(double)); \
  } \
  for (i99=0;i99<local_mesh->num_incident_vtx;i99++) { \
      for (j99=0;j99<NUM_DIR;j99++){ \
          temp99 = local_mesh->incident_vtx[i99][j99]; \
          write(fd99,&temp99,sizeof(double)); \
      }\
  } \
  if (NUM_DIR ==3 ) {\
    for (i99=0;i99<local_mesh->num_tri;i99++) { \
      for (j99=0;j99<NUM_DIR;j99++) {\
          temp99 = (double) local_mesh->vtx_connectivity[i99][j99]; \
          write(fd99,&temp99,sizeof(double)); \
      } \
    } \
  } \
  close(fd99); \
}

#define PRINT_FUNCTION_VALUES(opt_info) \
{ \
  int i99; \
  for (i99=0;i99<opt_info->num_values;i99++) { \
      printf("Index %d Function Value %f \n",i99,opt_info->function[i99]); \
  } \
}

#define SM_RECORD_ITER_VALUE(opt_info) \
{ \
    opt_info->prev_active_values[opt_info->iter_count] = opt_info->active->true_active_value; \
}

#if (NUM_DIR == 2)
#define SM_COPY_NUMDIR_VECTOR(a,b) { \
    a[0] = b[0];  a[1] = b[1]; \
}
#define SM_DOT(c,a,b) c = a[0]*b[0] + a[1]*b[1]
#define SM_NORMALIZE(v) { \
    double mag99; \
    mag99 = sqrt(v[0]*v[0] + v[1]*v[1]) ; \
    if (mag99 != 0) { \
       v[0] = v[0]/mag99; \
       v[1] = v[1]/mag99; \
    } \
}
#elif (NUM_DIR == 3)
#define SM_COPY_NUMDIR_VECTOR(a,b) { \
     a[0] = b[0];  a[1] = b[1];  a[2] = b[2]; \
}
#define SM_DOT(c,a,b) c = a[0]*b[0] + a[1]*b[1] + a[2]*b[2]
#define SM_NORMALIZE(v) { \
     double mag99; \
     mag99 = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]) ; \
     if (mag99 != 0) { \
         v[0] = v[0]/mag99; \
         v[1] = v[1]/mag99; \
         v[2] = v[2]/mag99; \
     } \
}
#endif

#define SM_COPY_GEN_VECTOR(a,b,n) { \
    int i99; \
    for (i99=0;i99<n;i99++) a[i99] = b[i99]; \
}



More information about the KDevelop mailing list