IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 25, 2009, 2:00:56 PM (17 years ago)
Author:
eugene
Message:

merging changes from head

Location:
branches/eam_branches/20090522
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090522

  • branches/eam_branches/20090522/extsrc/gpcsw

    • Property svn:ignore
      •  

        old new  
        55man
        66Makefile
         7Makefile.bak
  • branches/eam_branches/20090522/extsrc/gpcsw/gpcsrc/fits/libfh/fh.c

    r23490 r24557  
    200200/* Functions that do file operations WITH RETRY: */
    201201static int write_file(int fd, const void* buf, int len);
    202 static int read_file(int fd, const void* buf, int len);
     202static int read_file(int fd, void* buf, int len);
    203203static int seek_file(int fd, off_t off); /* Performs lseek(SEEK_SET) */
    204204static int fh_lock_file(HeaderUnit hu, int fd, fh_mode mode);
     
    234234 * this information in debug mode.
    235235 */
     236const char* fh_rcs_version(void); /* proto to make gcc happy */
    236237const char* fh_rcs_version(void) { return rcs_id; }
    237238
     
    274275
    275276static void
    276 null_log(const char* s) { if (s) ; }
     277null_log(const char* s) { if (s) return; }
    277278/*
    278279 * It's also possible to pass a NULL to fh_log_xxx() and rely only on the
     
    309310
    310311HeaderUnit
    311 fh_create()
     312fh_create(void)
    312313{
    313314   HeaderUnitStruct* rtn;
     
    19411942   HeaderUnitStruct* list = FH_HU(hu);
    19421943   char writebuf[FH_BLOCK_SIZE];
    1943    int i = 0, writelen;
     1944   int i = 0;
     1945   unsigned int writelen;
    19441946   int blocks_left;
    19451947   fh_result result;
     
    24462448   else /* byte-swapping case requires a temporary buffer */
    24472449   {
    2448       unsigned char outbuf[32768];
     2450      unsigned char* outbuf[32768];
    24492451
    24502452      while (bytes_left)
     
    28112813   while (len)
    28122814   {
    2813       rtn = write(fd, (char*)buf, len);
     2815      rtn = write(fd, (const char*)buf, len);
     2816
     2817      switch (rtn)
     2818      {
     2819         case -1: if (errno == EINTR || errno == EAGAIN)
     2820            continue; /* retry */
     2821            return -1; /* permanent failure */
     2822         case 0: return count;
     2823         default:
     2824         {
     2825            len -= rtn;
     2826            count += rtn;
     2827            buf = (const char*)buf + rtn;
     2828         }
     2829      }
     2830   }
     2831   return count;
     2832}
     2833
     2834static int
     2835read_file(int fd, void* buf, int len)
     2836{
     2837   int rtn;
     2838   int count = 0;
     2839
     2840   while (len)
     2841   {
     2842      rtn = read(fd, (char*)buf, len);
    28142843
    28152844      switch (rtn)
     
    28312860
    28322861static int
    2833 read_file(int fd, const void* buf, int len)
    2834 {
    2835    int rtn;
    2836    int count = 0;
    2837 
    2838    while (len)
    2839    {
    2840       rtn = read(fd, (char*)buf, len);
    2841 
    2842       switch (rtn)
    2843       {
    2844          case -1: if (errno == EINTR || errno == EAGAIN)
    2845             continue; /* retry */
    2846             return -1; /* permanent failure */
    2847          case 0: return count;
    2848          default:
    2849          {
    2850             len -= rtn;
    2851             count += rtn;
    2852             buf = (char*)buf + rtn;
    2853          }
    2854       }
    2855    }
    2856    return count;
    2857 }
    2858 
    2859 static int
    28602862seek_file(int fd, off_t off)
    28612863{
     
    29692971fh_compare(const void* a, const void* b)
    29702972{
    2971    double diff = (*((FitsCard**)a))->idx - (*((FitsCard**)b))->idx;
     2973   double diff = (*((FitsCard* const*)a))->idx - (*((FitsCard* const*)b))->idx;
    29722974
    29732975   if (diff < 0) return -1;
Note: See TracChangeset for help on using the changeset viewer.