IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29537


Ignore:
Timestamp:
Oct 25, 2010, 12:36:40 PM (16 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20100823

Location:
trunk/Ohana/src
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libautocode/Makefile.Targets

    r27579 r29537  
    5959$(ASRC)/cmf-ps1-v1.$(ARCH).o \
    6060$(ASRC)/cmf-ps1-v2.$(ARCH).o \
     61$(ASRC)/cmf-ps1-v3.$(ARCH).o \
    6162$(ASRC)/cmf-smpdata.$(ARCH).o \
    6263$(ASRC)/getstar-ps1-dev-0.$(ARCH).o \
     
    129130$(AINC)/cmf-ps1-v1.h \
    130131$(AINC)/cmf-ps1-v2.h \
     132$(AINC)/cmf-ps1-v3.h \
    131133$(AINC)/cmf-smpdata.h \
    132134$(AINC)/getstar-ps1-dev-0.h \
  • trunk/Ohana/src/libautocode/def/autocode.c

    r29001 r29537  
    2525}
    2626
    27 $STRUCT *gfits_downsize_and_convert_$STRUCT ($STRUCT *data, off_t size, off_t nitems) {
    28 
    29   off_t i;
    30   unsigned char *byte, tmp;
    31   $STRUCT *output;
    32 
    33   if ($SIZE > size) {
    34     fprintf (stderr, "ERROR: uncorrectable mismatch in data types $STRUCT: "OFF_T_FMT" vs %d\n",  size,  $SIZE);
    35     exit (1);
    36   }
    37 
    38   // allocate a new array
    39   ALLOCATE (output, $STRUCT, nitems);
    40   for (i = 0; i < nitems; i++) {
    41     memcpy (&output[i], &data[i], $SIZE);
    42   }
    43 
    44   /* provide initial values to avoid compiler warnings for non-BYTE_SWAP arch */
    45   i = tmp = 0;
    46   byte = NULL;
    47 
    48 # ifdef BYTE_SWAP
    49   byte = (unsigned char *) output;
    50   for (i = 0; i < nitems; i++, byte += size) {
    51     /** BYTE SWAP **/
    52   }
    53 # endif 
    54 
    55   return (output);
    56 }
    57 
    5827/*** add test of EXTNAME and header-defined columns? ***/
    5928/* return internal structure representation */
     
    6130
    6231  int Ncols;
    63   $STRUCT *data, *output;
     32  $STRUCT *data;
    6433
    6534  Ncols = ftable[0].header[0].Naxis[0];
     
    7342  if ((swapped == NULL) || (*swapped == FALSE)) {
    7443    if (!gfits_convert_$STRUCT (data, sizeof ($STRUCT), *Ndata)) {
    75       output = gfits_downsize_and_convert_$STRUCT (data, sizeof ($STRUCT), *Ndata);
    76       free (ftable[0].buffer);
    77       ftable[0].buffer = (char *) output;
    78       // XXX do I need to change NX?
     44      return NULL;
    7945    }
    8046    gfits_table_scale_data (ftable);
  • trunk/Ohana/src/libdvo/src/cmf-ps1-v1-alt.c

    r29001 r29537  
    11# include "dvo.h"
     2
     3/* if we are not correctly including the ohana headers, this will fail */
     4# ifndef BYTE_SWAP
     5# ifndef NOT_BYTE_SWAP
     6# error "neither BYTE_SWAP not NOT_BYTE_SWAP is set"
     7# endif
     8# endif
    29
    310CMF_PS1_V2 *gfits_table_get_CMF_PS1_V1_Alt (FTable *ftable, off_t *Ndata, char *swapped) {
  • trunk/Ohana/src/libfits/header/F_H_field.c

    r27435 r29537  
    1111
    1212  if (header[0].buffer == NULL) return NULL;
     13
     14  // regular keywords cannot be larger than 8 chars (use HIERARCH instead)
     15  if (strlen(field) > 8) return NULL;
    1316
    1417  /* create a blank-padded keyword with exactly 8 characters */
  • trunk/Ohana/src/libfits/include/gfitsio.h

    r28241 r29537  
    1313# endif
    1414
     15/* if we are not correctly including the ohana headers, this will fail */
    1516# ifndef NEWLINE
    1617# define NEWLINE                 10  /* UNIX RETURN character */
  • trunk/Ohana/src/libkapa/include/kapa.h

    r27790 r29537  
    1212# include <png.h>
    1313# include <dvo.h>
     14
     15/* if we are not correctly including the ohana headers, this will fail */
     16# ifndef BYTE_SWAP
     17# ifndef NOT_BYTE_SWAP
     18# error "neither BYTE_SWAP not NOT_BYTE_SWAP is set"
     19# endif
     20# endif
    1421
    1522typedef struct sockaddr_in KapaSockAddress;
  • trunk/Ohana/src/libkapa/src/RotFont.c

    r5854 r29537  
    1010static RotFont *currentfont;
    1111
     12static int RotFontInited = FALSE;
     13
    1214void InitRotFonts () {
    1315
    1416  int i, Nhardwired;
     17
     18  if (RotFontInited) return;
     19  RotFontInited = TRUE;
    1520
    1621  Nhardwired = sizeof (HardwiredFonts) / sizeof (FontSet);
     
    3237 
    3338  int i, nsize, msize, bsize, bigger, dsize, match, good;
     39
     40  InitRotFonts();
    3441
    3542  bigger = good = match = -1;
     
    6976char *GetRotFont (int *size) {
    7077
     78  InitRotFonts();
     79
    7180  *size = currentsize;
    7281  return (currentname);
     
    7584
    7685RotFont *GetRotFontData (double *scale) {
     86
     87  InitRotFonts();
     88
    7789  *scale = currentscale;
    7890  return (currentfont);
     
    8496  double scale;
    8597 
     98  InitRotFonts();
     99
    86100  scale = currentscale;
    87101
  • trunk/Ohana/src/libkapa/src/bDrawFuncs.c

    r5999 r29537  
    11# include <kapa_internal.h>
     2
     3// XXX we can get rid of these static vars by making them elements of the bDrawBuffer
     4//
     5
    26
    37static int bWeight;
  • trunk/Ohana/src/libohana/include/ohana.h

    r28645 r29537  
    9494};
    9595
    96 /* note: in the Ohana tree, the byte order is determined by the ARCH variable
    97    if you have a small endian machine that is not listed here, the test
    98    program 'typestest' should fail */
     96/* Some notes on the Ohana BYTE_SWAP macros:
     97
     98   1) BYTE_SWAP is set in this file based on the environment variable 'ARCH', which is in turn
     99   set by the psconfig system (or is set manually by the builder). 
     100
     101   2) BYTE_SWAP is only used when building the Ohana tree: code which links against Ohana
     102   (eg, libkapa or others) does not need to have this value correctly set.
     103   
     104   3) the libohana build tests for the validity of the BYTE_SWAP choice by running the test
     105   program 'typestest' and raising an error if the tests fail.
     106
     107   4) if your build fails due to the typestest program, check your value of 'ARCH' and if
     108   necessary add it to the list below.
     109
     110*/
     111
    99112# ifndef BYTE_SWAP
    100113# ifdef linux
     
    117130# define BYTE_SWAP
    118131# endif
    119 # else
     132# endif /* BYTE_SWAP */
     133
     134/* other Ohana components use these two values to check that ohana.h was correctly included */
     135# ifndef BYTE_SWAP
    120136# define NOT_BYTE_SWAP
    121 # endif /* BYTE_SWAP */
     137# endif
    122138
    123139# ifndef NAN
  • trunk/Ohana/src/libohana/src/Fread.c

    r27435 r29537  
    1414  tmp = byte[X+2]; byte[X+2] = byte[X+5]; byte[X+5] = tmp; \
    1515  tmp = byte[X+3]; byte[X+3] = byte[X+4]; byte[X+4] = tmp;
    16 
    17 /** this is also used in libautocode/def/common.h -- consolidate **/
    18 # ifdef linux
    19 # define BYTE_SWAP
    20 # endif
    21 
    22 # ifdef sid
    23 # define BYTE_SWAP
    24 # endif
    25 
    26 # ifdef dec
    27 # define BYTE_SWAP
    28 # endif
    2916
    3017/* add other architectures here, ie dec, alpha, etc */
Note: See TracChangeset for help on using the changeset viewer.