Changeset 7513


Ignore:
Timestamp:
06/28/18 20:27:10 (3 weeks ago)
Author:
baker
Message:

cleanup warning: variable set but not used [-Wunused-but-set-variable]

Location:
trunk/src/libsrc/util
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libsrc/util/gd_lib/gd.c

    r6284 r7513  
    1  
    2 /* 
    3  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    4  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    5  * 
    6  *    $Id$ 
    7  * 
    8  *    Revision history: 
    9  *     $Log$ 
    10  *     Revision 1.3  2007/03/28 14:24:46  paulf 
    11  *     minor unix and MACOSX changes 
    12  * 
    13  *     Revision 1.2  2000/05/12 16:30:03  davidk 
    14  *     typecasted the return value of floor() to an int twice, to 
    15  *     get rid of compiler warning messages on NT about a double 
    16  *     being implicitly cast to an int. 
    17  * 
    18  *     Revision 1.1  2000/02/14 18:47:58  lucky 
    19  *     Initial revision 
    20  * 
    21  * 
    22  */ 
    23  
     1#include <math.h> 
    242#include <stdio.h> 
    25 #include <math.h> 
     3#include <stdlib.h> 
    264#include <string.h> 
    27 #include <stdlib.h> 
     5 
    286#include "gd.h" 
    297#include "mtables.c" 
     
    15561534       int imageNumber; 
    15571535       int BitPixel; 
     1536/* We may eventually want to use this information, but def it out for now */ 
     1537#if 0 
    15581538       int ColorResolution; 
    15591539       int Background; 
    15601540       int AspectRatio; 
     1541#endif 
    15611542       int Transparent = (-1); 
    15621543       unsigned char   buf[16]; 
     
    15891570        } 
    15901571       BitPixel        = 2<<(buf[4]&0x07); 
     1572/* We may eventually want to use this information, but def it out for now */ 
     1573#if 0 
    15911574       ColorResolution = (int) (((buf[4]&0x70)>>3)+1); 
    15921575       Background      = buf[5]; 
    15931576       AspectRatio     = buf[6]; 
     1577#endif 
    15941578 
    15951579       if (BitSet(buf[4], LOCALCOLORMAP)) {    /* Global Colormap */ 
     
    25562540        im->interlace = interlaceArg; 
    25572541} 
    2558  
  • trunk/src/libsrc/util/geo_to_km.c

    r7034 r7513  
    11#include <stdio.h> 
    22#include <math.h> 
    3 #include <geo.h> 
     3 
     4#include "geo.h" 
    45 
    56/* 
     
    3839      double aa, bb, cc, dd, top, bottom, lambda12, az, temp; 
    3940      double v1, v2; 
    40       double fl, e, e2, eps, eps0; 
     41      double fl, e2, eps, eps0; 
    4142      double b0, x2, y2, z2, z1, u1p, u2p, xdist; 
    4243      double lat1rad, lat2rad, lon1rad, lon2rad; 
     
    6465      fl = ( a - b ) / a; 
    6566      e2 = 2.0*fl - fl*fl; 
    66       e  = sqrt(e2); 
    6767      eps = e2 / ( 1.0 - e2); 
    6868/* 
     
    219219      double aa, bb, cc, dd, top, bottom, lambda12, az, temp; 
    220220      double v1, v2; 
    221       double fl, e, e2, eps, eps0; 
     221      double fl, e2, eps, eps0; 
    222222      double b0, x2, y2, z2, z1, u1p, u2p, xdist; 
    223223      double lat1rad, lat2rad, lon1rad, lon2rad; 
     
    250250      fl = ( a - b ) / a; 
    251251      e2 = 2.0*fl - fl*fl; 
    252       e  = sqrt(e2); 
    253252      eps = e2 / ( 1.0 - e2); 
    254253      onemec2 = 1.0 - e2; 
     
    440439      double g0, g2, g4, g6; 
    441440      double latrad, lonrad, azmrad; 
    442       double ec, ec2, eps, eps0,       fl; 
    443       double tanu1p, tanmu, sinu1, sinu2; 
     441      double ec2, eps, eps0,       fl; 
     442      double tanmu; 
    444443      double tanlat, coslat, sinlat, tanazm, sinazm, cosazm; 
    445       double v1, u2, u1p, u2p, u1pbot, x2, y2, z2, ztop, zbot; 
    446       double arg, temp,        mu, sd, sig1      ; 
     444      double v1, u1p, u2p, u1pbot, x2, y2, z2, ztop, zbot; 
     445      double temp,        mu, sd, sig1      ; 
    447446      /* double sig2, eps2, delta; */ 
    448447 
     
    467466      fl = ( a - b ) / a;         /* earth flattening                 */ 
    468467      ec2 = 2.0*fl-fl*fl;         /* square of eccentricity           */ 
    469       ec = sqrt(ec2);             /* eccentricity                     */ 
    470468      eps = ec2/(1.0-ec2);        /* second eccentricity e'*e' = eps  */ 
    471469      torad = PI / 180.0; 
    472470      todeg = 1.0 / torad; 
    473471 
    474 /* - Convert event location to radians.                                    */ 
     472/* - Convert event location to radians.                               */ 
    475473 
    476474      temp=olat; 
     
    501499 
    502500 
    503       tanu1p = tanlat / (cosazm*sqrt(1.0+eps0)); 
    504501      u1pbot = cosazm * sqrt(1.0+eps0); 
    505502      u1p=atan2(tanlat,u1pbot); 
     
    514511      u2p=u1p+aa+2.0*g2*sin(aa)*cos(bb)+2.0*g4*sin(2.*aa)*cos(2.*bb)+ 
    515512          2.*g6*sin(3.*aa)*cos(3.*bb); 
    516       sinu1=tanlat/sqrt(1.0+eps+tanlat*tanlat); 
    517       sinu2 = ((b0*C)/b)*sin(u2p)-((eps-eps0)/(1+eps0))*sinu1; 
    518       u2 = asin(sinu2); 
    519  
    520 /*  This calculation of latitude is based on Rudoe's formulation, which has 
    521     not been tested  */ 
    522 /*      arg = sinu2/sqrt(1.0-eps*eps*cos(u2)*cos(u2));                       */ 
    523 /*    *lat = asin(arg)*todeg;                                                */ 
     513 
     514/*  This calculation of latitude is based on Rudoe's formulation, which 
     515    has not been tested  */ 
     516 
     517/*    sinu1=tanlat/sqrt(1.0+eps+tanlat*tanlat);                       */ 
     518/*    sinu2 = ((b0*C)/b)*sin(u2p)-((eps-eps0)/(1+eps0))*sinu1;        */ 
     519/*    u2 = asin(sinu2);                                               */ 
     520/*    arg = sinu2/sqrt(1.0-eps*eps*cos(u2)*cos(u2));                  */ 
     521/*    *lat = asin(arg)*todeg;                                         */ 
    524522 
    525523      a0 = b0*sqrt(1.0+eps0); 
     
    527525      mu = atan(tanmu); 
    528526 
    529 /*  This calculation of longitude is based on Ruloe's formulation, which has 
    530     not been tested  */ 
    531 /*    arg = (a0*cos(u2p))/(a*cos(u2));                                       */ 
    532 /*    delta = acos(arg)-mu;                                                  */ 
    533 /*    *lon = (lonrad + delta)*todeg;                                         */ 
     527/*  This calculation of longitude is based on Ruloe's formulation, which 
     528    has not been tested  */ 
     529 
     530/*    arg = (a0*cos(u2p))/(a*cos(u2));                                */ 
     531/*    delta = acos(arg)-mu;                                           */ 
     532/*    *lon = (lonrad + delta)*todeg;                                  */ 
    534533 
    535534/* 
     
    548547      *lon = (atan(y2/x2)+lonrad)*todeg; 
    549548      if((atan(y2/x2)+lonrad)<0.0) *lon=((atan(y2/x2)+lonrad)*todeg); 
    550       arg = atan2(y2,x2)*todeg; 
    551549} 
  • trunk/src/libsrc/util/gma.c

    r4929 r7513  
    1 /* 
    2  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    3  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    4  * 
    5  *    $Id$ 
    6  * 
    7  *    Revision history: 
    8  *     $Log$ 
    9  *     Revision 1.2  2004/03/17 21:05:39  lucky 
    10  *     *** empty log message *** 
    11  * 
    12  *     Revision 1.1  2002/02/28 17:00:39  lucky 
    13  *     Initial revision 
    14  * 
    15  * 
    16  */ 
    17  
    181/* gma.c: Routines for the ground motion analyzer: compute PGA, PGV, PGD * 
    192 *        and spectral response, using spectral techniques               */ 
    203 
     4#include <math.h> 
    215#include <stdio.h> 
    226#include <stdlib.h> 
    237#include <string.h> 
    24 #include <math.h> 
    25 #include <fft_prep.h> 
    26 #include <fft99.h> 
    27 #include <transfer.h> 
    28 #include <gma.h> 
    29 #include <earthworm.h> 
     8 
     9#include "earthworm.h" 
     10#include "fft_prep.h" 
     11#include "fft99.h" 
     12#include "transfer.h" 
     13#include "gma.h" 
    3014 
    3115#define MAXLINE 80 
     
    3923void cmpmax(long kug, double *ug, double w, double damp, double delta,  
    4024            double *zd, double *zv, double *za); 
    41  
    4225 
    4326/* 
     
    9982  FACT *pfact; 
    10083  double *acc, *vel, *disp, *psa; 
    101   double *fAccR, *fAccI, *fIntR, *fIntI; 
     84  double *fAccR, *fAccI, *fIntI; 
    10285  double *fPsaR, *fPsaI; 
    10386  double dre, dim;   /* temporary values */ 
    104   double delfreq, f, rnfft, tpr, accr, acci, minDamp, maxPeriod; 
     87  double delfreq, f, tpr, accr, acci, minDamp, maxPeriod; 
    10588  long flen, i, ii, retval = 0; 
    10689  long nfft, nfreq, trial_nfft, psaPadLen, ntaper; 
     
    11497  fAccR = work;            
    11598  fAccI = &work[flen];     
    116   fIntR = &work[flen * 2];  /* We never use this; it is treated as zero */ 
     99/*fIntR = &work[flen * 2];*//* We never use this; it is treated as zero */ 
    117100  fIntI = &work[flen * 3]; 
    118101  fPsaR = &work[flen * 4]; 
     
    251234  /* Compute acceleration, velocity and displacement output data in the  
    252235     frequency domain */ 
    253   rnfft = 1.0 / (2*nfft); 
     236  /* rnfft = 1.0 / (2*nfft); */ 
    254237 
    255238  acc[0] = 0.0;   /* Remove the mean, if there is any */ 
  • trunk/src/libsrc/util/k2evt2ew.c

    r7211 r7513  
    1 /* 
    2  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    3  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    4  * 
    5  *    $Id$ 
    6  * 
    7  *    Revision history: 
    8  *     $Log$ 
    9  *     Revision 1.11  2008/02/23 21:19:29  luetgert 
    10  *     Made sure reported time is not in the future. 
    11  *     . 
    12  * 
    13  *     Revision 1.10  2007/08/03 05:14:51  luetgert 
    14  *     Gravity changed from 978.03 to 981. 
    15  *     . 
    16  * 
    17  *     Revision 1.9  2005/07/20 15:08:10  friberg 
    18  *     cleaned up a warning about tags at end of #endif statements 
    19  * 
    20  *     Revision 1.8  2004/03/10 23:17:48  luetgert 
    21  *     Make sure both the site name and serial number are checked! 
    22  *     Kinemetrics has the nasty habit of duplicating serial numbers! 
    23  * 
    24  *     Revision 1.7  2004/02/23 19:12:46  luetgert 
    25  *     Redefined sm.t as trigger time instead of stream start time. 
    26  * 
    27  *     Revision 1.6  2003/01/09 00:45:29  davidk 
    28  *     Improved handling of evt files that are greater that the size of 
    29  *     MAXTRACELTH, which is the maximum number of samples per channel per 
    30  *     EVT file. 
    31  *     Improved error reporting and handling. 
    32  * 
    33  *     Revision 1.5  2002/11/07 18:33:41  lucky 
    34  *     The conversion from box/chan to SCNL was still wrong.  Fixed it again, 
    35  *     this time hopefully for good. 
    36  * 
    37  *     Revision 1.4  2002/08/16 20:51:00  alex 
    38  *     Mod to do checksums etc. Alex 
    39  * 
    40  *     Revision 1.3  2002/02/25 21:28:27  lucky 
    41  *     Fixed the translation from box to SCN 
    42  * 
    43  *     Revision 1.1  2001/11/19 16:17:59  lucky 
    44  *     Initial revision 
    45  * 
    46  * 
    47  */ 
    48  
    491/*  k2hder2ew.c 
    502 *  Read a K2-format .evt data file, crack the header, and fill 
     
    13183    int      flen,  stat, nchans, itype[18], azim[18]; 
    13284    uint32_t  decade, channels; 
    133     float   dt, scale[18], sec1970; 
     85    float   dt, scale[18]; 
    13486 
    13587        if ((fp == NULL) || (fname == NULL) || (pk2info == NULL)) 
     
    14698 
    14799        K2EW_Debug = Debug; 
    148         sec1970 = (float) 11676096000.00; /* # seconds between Carl Johnson's */ 
     100/*      sec1970 = (float) 11676096000.00; */ /* # seconds between Carl Johnson's */ 
    149101                                      /* time 0 and 1970-01-01 00:00:00.0 GMT */ 
    150102 
     
    167119        if ( ret != EW_SUCCESS ) return EW_FAILURE; 
    168120    stat = read_head(fp, &pk2info->head, pk2info->tag.length); 
     121    if ( stat != EW_SUCCESS ) 
     122        return stat; 
    169123 
    170124    ret = read_tag(fp, &pk2info->tag); 
     
    271225        if ( ret != EW_SUCCESS ) return EW_FAILURE; 
    272226           stat = read_head(fp, &pk2info->head, pk2info->tag.length); 
     227           if ( stat != EW_SUCCESS ) 
     228              return stat; 
    273229 
    274230                /* initialize trace buffer */ 
     
    302258               read_frame(fp, &pk2info->frame, &channels); 
    303259               flen = pk2info->tag.dataLength; 
    304                stat = (int)fread(g_k2mi_buff, 1, flen, fp); 
     260               if ( fread(g_k2mi_buff, 1, flen, fp) != 1 ) 
     261               { 
     262                 logit ("e", "k2evt2ew: read of file failed.\n"); 
     263                 return EW_FAILURE; 
     264               } 
     265 
    305266               ret = extract(flen, g_k2mi_buff, pk2info->Databuf[i], pk2info->Counts[i],  
    306267                        scale[i], nchans, i, &pk2info->numDataPoints[i], MAXTRACELTH); 
     
    915876int peak_ground(float *Data, int npts, int itype, float dt, SM_INFO *sm) 
    916877{ 
    917     int     imax_acc, imax_vel, imax_dsp, imax_raw; 
    918     int     imin_acc, imin_vel, imin_dsp, imin_raw; 
    919     int     ii, kk, kpts, id[4], npd[2], icaus, maxtime; 
    920     float  totint, a, tpi, omega, damp, rd, rv, aa; 
     878    int    imax_acc, imax_vel, imax_dsp, imax_raw; 
     879    int    imin_acc, imin_vel, imin_dsp, imin_raw; 
     880    int    kk, icaus, maxtime; 
     881    float  totint, tpi, omega, damp, rd, rv, aa; 
    921882    float  amax_acc, amin_acc, pmax_acc; 
    922883    float  amax_vel, amin_vel, pmax_vel; 
    923884    float  amax_dsp, amin_dsp, pmax_dsp; 
    924     float  amax_raw, amin_raw, pmax_raw, gd[4], sd[4]; 
     885    float  amax_raw, amin_raw, pmax_raw; 
    925886 
    926887    /* Made these float arrays static because Solaris was Segfaulting on an 
     
    932893          static float    d3[MAXTRACELTH]; 
    933894 
    934     gd[0] = 0.05f; 
    935     gd[1] = 0.10f; 
    936     gd[2] = 0.20f; 
    937     gd[3] = 0.50f; 
    938895    icaus = 1; 
    939896 
     
    1035992 
    1036993    sm->nrsa = kk; 
    1037  
    1038 /* Since we are here, determine the duration of strong shaking 
    1039  *************************************************************/ 
    1040  
    1041     for(kk=0;kk<4;kk++) { 
    1042         id[kk] = 0; 
    1043         for(ii=1;ii<=npts-1;ii++) { 
    1044             a = (float)fabs(d3[ii]/GRAVITY); 
    1045             if (a >= gd[kk]) { 
    1046                 id[kk]++; 
    1047                 if (id[kk] == 1) npd[0] = ii; 
    1048                 npd[1] = ii; 
    1049             } 
    1050         } 
    1051         if (id[kk] > 0) { 
    1052             kpts = npd[1] - npd[0] + 1; 
    1053             sd[kk] = kpts*dt; 
    1054         } else { 
    1055             sd[kk] = 0.0; 
    1056         } 
    1057     } 
    1058994 
    1059995    sm->pgd = fabs(amin_dsp)>fabs(amax_dsp)? fabs(amin_dsp):fabs(amax_dsp); 
  • trunk/src/libsrc/util/kom.c

    r7446 r7513  
    1 /* 
    2  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    3  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    4  * 
    5  *    $Id$ 
    6  * 
    7  *    Revision history: 
    8  *     $Log$ 
    9  *     Revision 1.6  2008/03/05 13:02:23  quintiliani 
    10  *     Minor change: substituted comment // to /star star/ 
    11  * 
    12  *     Revision 1.5  2008/03/05 08:20:52  quintiliani 
    13  *     Minor change: substituted comment // to /star star/ 
    14  * 
    15  *     Revision 1.4  2007/07/25 23:58:08  hal 
    16  *     * config reading (from files and strings) is now line-termination-agnostic 
    17  *     * k_rd() and k_put() have been merged, as most of their code was identical 
    18  * 
    19  *     Revision 1.3  2004/03/22 21:20:36  kohler 
    20  *     Changed "static struct K_buf" to "struct k_buf" 
    21  * 
    22  *     Revision 1.2  2001/10/05 20:42:15  dietz 
    23  *     Increased MAXCRD to 1024 (was 512) 
    24  * 
    25  *     Revision 1.1  2000/02/14 18:51:48  lucky 
    26  *     Initial revision 
    27  * 
    28  * 
    29  */ 
    30  
    311/* 
    322 * kom.c : Simple positional command parser. 
     
    4515/****************************************************************************/ 
    4616 
     17#include <stdarg.h> 
    4718#include <stdio.h> 
    4819#include <stdlib.h> 
    4920#include <string.h> 
    50 #include <stdarg.h> 
    51 #include <kom.h> 
     21 
     22#include "kom.h" 
    5223 
    5324#define BOOL_EXPANSION_FROM_ENV(x)  ( (x==KOM_EXPANSION_FROM_ENV)? 1 : 0 ) 
     
    7950{ 
    8051    va_list listptr; 
    81     int retvalue = 0; 
    8252    char message[KOM_MAX_LOG_MESSAGE_LENGTH]; 
    8353 
    8454    if(kom_log_func != NULL) { 
    8555      va_start(listptr, format); 
    86       retvalue = vsnprintf(message, (size_t) KOM_MAX_LOG_MESSAGE_LENGTH, format, listptr); 
     56      vsnprintf(message, (size_t) KOM_MAX_LOG_MESSAGE_LENGTH, format, listptr); 
    8757      kom_log_func(message); 
    8858      va_end(listptr); 
     
    767737    char *ret; 
    768738    /* 0 environment getenv(), 1 earthworm file GetEnvVarValueFromFile() */ 
    769     int source = 0; 
     739/*  int source = 0; */ 
    770740    char *value_from_file = NULL; 
    771741    char *value_from_environment = NULL; 
     
    776746        value_from_file = GetEnvVarValueFromFile( envvar_name ); 
    777747        if(value_from_file) { 
    778             source = 1; 
     748/*          source = 1; */ 
    779749            ret = value_from_file; 
    780750        } else { 
     
    920890    return ret; 
    921891} 
    922  
  • trunk/src/libsrc/util/parse_usnsn.c

    r7099 r7513  
    1  
    2 /* 
    3  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    4  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    5  * 
    6  *    $Id$ 
    7  * 
    8  *    Revision history: 
    9  *     $Log$ 
    10  *     Revision 1.13  2004/04/12 22:09:30  dietz 
    11  *     included string.h 
    12  * 
    13  *     Revision 1.12  2002/03/22 20:44:24  lucky 
    14  *     pre v6.1 checkin 
    15  * 
    16  *     Revision 1.11  2001/08/02 22:40:21  davidk 
    17  *     typecast some double to float assignments to eliminate compiler 
    18  *     warnings on NT. 
    19  * 
    20  *     Revision 1.10  2001/04/17 17:49:37  lucky 
    21  *     *** empty log message *** 
    22  * 
    23  *     Revision 1.8  2000/10/02 21:29:58  lucky 
    24  *     The Debug printout of the entire file is now done only in extreme cases of 
    25  *     Debug being set to 10. 
    26  *     Changed the max length of phase field to PHA_LEN 
    27  * 
    28  *     Revision 1.7  2000/09/12 18:13:25  lucky 
    29  *     Plugged memory leak with nsnbuf. 
    30  * 
    31  *     Revision 1.6  2000/06/26 20:36:41  lucky 
    32  *     NSN deletion now works! 
    33  * 
    34  *     Revision 1.5  2000/06/26 20:04:39  lucky 
    35  *     When encountering a delete message, we return RETURN_DELETE to the 
    36  *     calling program so that it can handle it appropriately. 
    37  * 
    38  *     Revision 1.4  2000/05/31 16:16:58  lucky 
    39  *     Fixed the check for deletion message -- used to be in line #4, now it 
    40  *     #3 
    41  * 
    42  *     Revision 1.3  2000/05/02 19:50:54  lucky 
    43  *     Cosmetic fixes needed to have NT compile without warnings. 
    44  * 
    45  *     Revision 1.2  2000/04/06 16:03:07  lucky 
    46  *     We now check to see if we got a Delete message. For now, we don't do anything 
    47  *     about it, only log a message and return FAILURE in hopes that the calling 
    48  *     program will deal with the consequences. 
    49  * 
    50  *     Revision 1.1  2000/02/14 18:51:48  lucky 
    51  *     Initial revision 
    52  * 
    53  * 
    54  */ 
    55  
    561/* 
    572 
     
    7722*/ 
    7823       
    79  
     24#include <math.h> 
    8025#include <stdio.h> 
    8126#include <stdlib.h> 
    8227#include <string.h> 
    83 #include <math.h> 
    84 #include <parse_usnsn.h> 
    85 #include <earthworm.h> 
    86 #include <rw_mag.h> 
     28 
     29#include "earthworm.h" 
     30#include "parse_usnsn.h" 
     31#include "rw_mag.h" 
    8732 
    8833#define     MAX_LINES       1000 
    8934#define     MAX_LINE_SIZE   300 
    90  
    9135 
    9236extern  int             epochsec17 (double *, char *); 
     
    10650 ************************************************************************/ 
    10751int     ParseNSNMsg (char *NsnMsg, int msgLen,  
    108                                 NSNStruct *msgStruct, int debug, char *debug_dir) 
     52                        NSNStruct *msgStruct, int debug, char *debug_dir) 
    10953{ 
    11054        int             i, j; 
     
    11963    char    **nsnbuf; 
    12064    int     nlines; 
    121     int     isAuto; 
    122  
    12365 
    12466 
     
    167109        sscanf (nsnbuf[lineno], "%s\n", tmp1); 
    168110        if (strcmp (tmp1, "The") == 0) 
    169         { 
    170111                /* Yup, it's an automatic: skip four more lines */ 
    171112                lineno = lineno + 4; 
    172                 isAuto = 1; 
    173         } 
    174         else 
    175         { 
    176                 /* it's a reviewed solution message: we are at the first line */ 
    177                 isAuto = 0; 
    178         } 
    179  
     113        /* Else, it's a reviewed solution message: we are at the first line */ 
    180114 
    181115/* 
     
    11031037 
    11041038} 
    1105  
    1106  
    1107  
  • trunk/src/libsrc/util/priority_queue.c

    r1381 r7513  
    2424#include <stdlib.h> 
    2525#include <string.h> 
    26 #include <platform.h> 
    27 #include <earthworm.h> 
    28 #include <earthworm_complex_funcs.h> 
    29 #include <priority_queue.h> 
     26 
     27#include "platform.h" 
     28#include "earthworm.h" 
     29#include "earthworm_complex_funcs.h" 
     30#include "priority_queue.h" 
    3031 
    3132/* #define LOG_DEBUG 1  */ 
     
    249250   else 
    250251   { 
    251       EW_PRIORITY _usePri = p_priority; 
     252/*    EW_PRIORITY _usePri = p_priority; */ 
    252253 
    253254      long _queuesize = p_queue->queuesize 
     
    268269      { 
    269270         /* priority out of range, fall back to default */ 
    270          _usePri = EW_PRIORITY_DEF; 
     271/*       _usePri = EW_PRIORITY_DEF; */ 
    271272         /* keep this return status unless worse one arises */ 
    272273         r_status = EW_PRI_RETBADPRI; 
     
    640641   return r_status; 
    641642} 
    642  
    643  
    644  
    645  
    646  
    647  
  • trunk/src/libsrc/util/rw_mag.c

    r6360 r7513  
    1 /* 
    2  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    3  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    4  * 
    5  *    $Id$ 
    6  * 
    7  *    Revision history: 
    8  *     $Log$ 
    9  *     Revision 1.14  2008/09/02 15:25:52  paulf 
    10  *     removed malloc in this call 
    11  * 
    12  *     Revision 1.13  2004/04/12 22:11:47  dietz 
    13  *     included stdlib.h 
    14  * 
    15  *     Revision 1.12  2002/09/10 17:20:59  dhanych 
    16  *     Stable scaffold 
    17  * 
    18  *     Revision 1.11  2002/06/28 21:03:57  lucky 
    19  *     Fixed reading of mag phases -- it would not properly read float 
    20  *     values for amplitude and period 
    21  * 
    22  *     Revision 1.10  2001/08/07 16:54:17  lucky 
    23  *     Pre v6.0 checkin 
    24  * 
    25  *     Revision 1.9  2001/06/07 20:51:49  lucky 
    26  *     Modified wr_mag so that it checks for NULL strings. Before, if qid was null, 
    27  *     wr_mag would produce an invalid TYPE_MAGNITUDE message which could not 
    28  *     be parsed by rd_mag. This is not good, given that the qid is not known 
    29  *     in the review system. 
    30  * 
    31  *     Revision 1.8  2001/06/07 19:48:28  lucky 
    32  *     rd_chan_mag_lucky renamed to rd_chan_mag. The old rd_chan_mag is still 
    33  *     available as rd_chan_mag_Pete. 
    34  * 
    35  *     Revision 1.7  2001/05/31 21:09:02  lucky 
    36  *     Addedd rd_chan_mag_lucky; I don't think that rd_chan_mag in its original form 
    37  *     works. There are numerical comparisons of pointers, and other visible problems. 
    38  * 
    39  *     Revision 1.6  2001/05/26 21:04:59  lombard 
    40  *     Changed ML_INFO struct to MAG_CHAN_INFO struct to make it more 
    41  *     generic; now this struct should work with most mag types. 
    42  *     Fixed a number of obvious bugs and cleaned up the code. 
    43  *     But the parsers still have not been tested and this may not work. 
    44  * 
    45  *     Revision 1.5  2001/05/02 20:58:45  alex 
    46  *     *** empty log message *** 
    47  * 
    48  *     Revision 1.4  2001/05/01 22:38:48  davidk 
    49  *     moved the MagNames table out of the header file and into rw_mag.c 
    50  * 
    51  *     Revision 1.3  2001/05/01 20:26:02  davidk 
    52  *     Modified several new functions added by Alex, so that they compile and do not impede the 
    53  *     release.  The new functions have been added, but have not properly been tested and debugged, 
    54  *     at all. 
    55  * 
    56  *     Revision 1.2  2001/04/29 00:15:29  alex 
    57  *     Alex: changes for mag type int and string, and added alternate parsing routines. 
    58  * 
    59  *     Revision 1.1  2001/03/31 00:44:58  lombard 
    60  *     Initial revision 
    61  * 
    62  * 
    63  * 
    64  */ 
    65  
    661/* rw_mag.c 
    672 * 
     
    7510#include <stdlib.h> 
    7611#include <string.h> 
    77 #include <earthworm.h> 
    78 #include <rw_mag.h> 
     12 
     13#include "earthworm.h" 
     14#include "rw_mag.h" 
    7915 
    8016/* Internal Function Prototypes */ 
     
    8420static char *findItemValue(const char *dataStr, const char *nameStr); 
    8521static void copyItemValue(char *destStr, const char *srcStr, int maxLen); 
    86  
    8722 
    8823/******************************************************************** 
     
    174109  int       len;       /* length (bytes) of the next token */ 
    175110  int       nchan;     /* number of channels read from msg so far */ 
    176   int       nML;       /* number of MAG_CHAN_INFO structures we can use */ 
    177111  int       rc; 
    178   int           index; 
     112  int       index; 
    179113   
    180114  memset(pMci, 0, size_ml); 
    181   nML = size_ml / sizeof(MAG_CHAN_INFO); 
    182115 
    183116  /* tmpMsg = (char *) malloc (msglen);  
  • trunk/src/libsrc/util/rw_strongmotionII.c

    r7042 r7513  
    1 /* 
    2  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    3  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    4  * 
    5  *    $Id$ 
    6  * 
    7  *    Revision history: 
    8  *     $Log$ 
    9  *     Revision 1.5  2004/02/13 22:55:22  dietz 
    10  *     Now both "?" and "-" are interpreted as NULL values for 
    11  *     qid and qauthor on the QID: line when reading TYPE_STRONGMOTIONII msgs 
    12  * 
    13  *     Revision 1.4  2003/06/09 19:53:50  lombard 
    14  *     Rewrote rd_strongmotionII to be more fault-tolerant and to allow reading of 
    15  *     multiple channels from a single message. 
    16  * 
    17  *     Revision 1.3  2001/06/19 17:26:02  dietz 
    18  *     Fixed wr_strongmotionII to print SM_NULL values properly (it had been 
    19  *     taking the absolute value of them by mistake) 
    20  * 
    21  *     Revision 1.2  2001/04/18 17:56:27  dietz 
    22  *     wr_strongmotionII: made sure pga,pgv,pgd are written as absolute values 
    23  * 
    24  *     Revision 1.1  2001/04/17 17:25:46  davidk 
    25  *     Initial revision 
    26  * 
    27  * 
    28  * 
    29  */ 
    30  
    311/* rw_strongmotionII.c 
    322 * 
     
    4010#include <string.h> 
    4111#include <time.h> 
    42 #include <chron3.h> 
    43 #include <time_ew.h> 
    44 #include <rw_strongmotionII.h> 
    45 #include <earthworm.h> 
     12 
     13#include "earthworm.h" 
     14#include "chron3.h" 
     15#include "time_ew.h" 
     16#include "rw_strongmotionII.h" 
    4617 
    4718#define ABS(X) (((X) >= 0) ? (X) : -(X)) 
     
    8657    return; 
    8758} 
    88  
    89  
    9059 
    9160/******************************************************************** 
     
    10675   char     line[SMLINE]; /* pointer to current line in msg */ 
    10776   char     *nextline;  /* working pointer into msg */ 
    108    int       nfreq; 
    10977   int       i; 
    11078   struct tm stm;       /* time structure for timestamp */ 
     
    11583 
    11684   nextline = *msgP; 
    117    nfreq = 0; 
    11885   smState = 0; 
    11986   status = 0; 
  • trunk/src/libsrc/util/sudsputaway.c

    r7405 r7513  
    1 /* 
    2  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    3  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    4  * 
    5  *    $Id$ 
    6  * 
    7  *    Revision history: 
    8  *     $Log$ 
    9  *     Revision 1.11  2004/07/16 20:44:00  lombard 
    10  *     Modified to provide minimal support for SEED location codes. 
    11  *     The file format produced by this code does not itself support 
    12  *     SEED location codes, so there isn't much this code can do about it. 
    13  * 
    14  *     Revision 1.10  2003/10/03 20:10:36  cjbryan 
    15  *     corrected initialization of SUDS structures 
    16  * 
    17  *     Revision 1.9  2002/01/08 17:02:29  cjbryan 
    18  *     In order to accommodate 24-bit broadband data, traces of data of longer than long are now clipped to +/-2147483648 
    19  * 
    20  *     Revision 1.8  2001/04/12 03:47:36  lombard 
    21  *     Major reorganization of SUDSPA_next to improve efficiency 
    22  *     Reformatted code; cleaned up lots of comments and logit calls 
    23  *     Removed mapping of NC component codes (only needed at UW) 
    24  *     Now traces of data larger than short in are clipped to +/- 32767 
    25  *     counts; before they were byte-truncated. 
    26  *     Initializes SUDS structures to zero before filling them. 
    27  * 
    28  *     Revision 1.7  2001/03/27 22:22:51  cjbryan 
    29  *     ensured that time portion of suds format is hhmmss and not hhmmss.ss as carried by EventTime variable 
    30  * 
    31  *     Revision 1.6  2001/03/22 20:55:12  cjbryan 
    32  *     deleted now obsolete EventInst variable 
    33  * 
    34  *     Revision 1.5  2001/03/21 23:15:23  cjbryan 
    35  *     integrated CVO subnet into output filename 
    36  * 
    37  *     Revision 1.4  2001/03/21 16:41:07  alex 
    38  *     added EventSubnet variable to carry subnet name through to 
    39  *     filename; deleted now extraneous EventMod variable 
    40  * 
    41  *     Revision 1.3  2001/03/21 02:23:03  alex 
    42  *     *** empty log message *** 
    43  * 
    44  *     Revision 1.2  2000/03/10 23:23:43  davidk 
    45  *     changed the sudsputaway routines to match the new PA_XXX 
    46  *     routines in putaway.c. 
    47  *     Moved the SUDSPA_XXX function prototypes to pa_other_head.h 
    48  * 
    49  *     Revision 1.1  2000/02/14 18:51:48  lucky 
    50  *     Initial revision 
    51  * 
    52  * 
    53  */ 
    54  
    55 /* sudsputaway.c  
     1/* sudsputaway.c 
    562    
    573        Routines for writing trace data in PC-SUDS format  
     
    6612*/ 
    6713 
     14#include <errno.h> 
     15#include <inttypes.h> 
    6816#include <limits.h> 
    6917#include <stdio.h> 
    7018#include <stdlib.h> 
    7119#include <string.h> 
    72 #include <errno.h> 
    73 #include <earthworm.h> 
    74 #include <inttypes.h> 
    7520#include <time.h> 
    76 #include <trace_buf.h> 
    77 #include <swap.h> 
    78 #include <ws_clientII.h> 
    79 #include <sudshead.h> 
    80 #include <pa_subs.h> 
     21 
     22#include "earthworm.h" 
     23#include "trace_buf.h" 
     24#include "swap.h" 
     25#include "ws_clientII.h" 
     26#include "sudshead.h" 
     27#include "pa_subs.h" 
    8128 
    8229#define TAG_FILE        '.tag'        /* file containing the last known file tag */ 
    8330#define MAXTXT           150 
    84  
    8531 
    8632FILE    *SUDSfp;                      /* file pointer for the SUDS file */ 
     
    330276  short  *s_data; 
    331277  int32_t *l_data = NULL; 
    332   float  *f_data; 
    333278  char   *msg_p;        /* pointer into tracebuf data */ 
    334279  char    datatype; 
     
    446391      break; 
    447392    case 'f': 
    448       f_data = (float *)msg_p; 
    449393      /* CLIP the data to 32-bit int */ 
    450394      for ( j = 0; j < nsamp; j++, nsamp_this_scn++ ) 
     
    945889  return EW_SUCCESS; 
    946890} 
    947  
  • trunk/src/libsrc/util/wfdiscputaway.c

    r7215 r7513  
    273273  //Used for current date in lddate in wfdisc record 
    274274  struct tm *t; 
    275   int chars_copied; 
     275  // int chars_copied; 
    276276  time_t current_time; 
    277277 
     
    300300  time(&current_time); 
    301301  t = localtime(&current_time); 
    302   chars_copied = (int)strftime(lddate, 19, " %Y%m%d %H:%M:%S", t); 
     302  // chars_copied = (int) 
     303     strftime(lddate, 19, " %Y%m%d %H:%M:%S", t); 
    303304  //printf ("Chars copied to string array: %d, array:%s\n", chars_copied, lddate); 
    304305 
  • trunk/src/libsrc/util/xfrm.c

    r7106 r7513  
    1 /* 
    2  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE 
    3  *   CHECKED IT OUT USING THE COMMAND CHECKOUT. 
    4  * 
    5  *    $Id: xfrm.c,v 1.1 2009/12/16 12:00:00 scott Exp $ 
    6  * 
    7  *    Revision history: 
    8  *     $Log: xfrm.c,v $ 
    9  * 
    10  *     Revision 1.1  2009/12/16 12:00:00 scott 
    11  *     Initial revision 
    12  * 
    13  * 
    14  */ 
    15  
    161/* 
    172 * xfrm.c:   
     
    662647        { 
    663648          char type = BaseCmd[i][1]; 
    664           char kind = BaseCmd[i][0]; 
     649          /* char kind = BaseCmd[i][0]; */ 
    665650          switch ( type ) { 
    666651          case 'S': /* String */ 
     
    668653            { 
    669654              strcpy( ParamTarget[i], str ); 
    670             } else { 
    671               kind = 0; 
     655/*          } else {    */ 
     656/*            kind = 0; */ 
    672657            } 
    673658            break; 
     
    11261111{ 
    11271112  XFRMSCNL *pSCNL; 
    1128   int ret, datasize; 
     1113  int ret; 
    11291114   
    11301115  pSCNL = (XFRMSCNL*)(pDb->scnls + (jSta * pDb->scnlRecSize)); 
     
    11581143  /* Check for useable data types: we only handle shorts and longs for now */ 
    11591144  if ( (inBuf->trh2.datatype[0] != 's' && inBuf->trh2.datatype[0] != 'i') || 
    1160         (inBuf->trh2.datatype[1] != '2' && inBuf->trh2.datatype[1] != '4') ) 
     1145       (inBuf->trh2.datatype[1] != '2' && inBuf->trh2.datatype[1] != '4') ) 
    11611146  { 
    11621147    logit("t","%s: unusable datatype <%s> from <%s.%s.%s.%s>; skipping\n", 
     
    11651150          inBuf->trh2.sta, inBuf->trh2.chan, inBuf->trh2.net, inBuf->trh2.loc); 
    11661151    return EW_WARNING; 
    1167   } 
    1168   else 
    1169   { 
    1170     datasize = inBuf->trh2.datatype[1]-'0'; 
    11711152  } 
    11721153 
Note: See TracChangeset for help on using the changeset viewer.