Changeset 42116
- Timestamp:
- Mar 16, 2022, 4:21:02 PM (4 years ago)
- Location:
- branches/eam_branches/ipp-20220316/Ohana/src
- Files:
-
- 14 edited
-
addstar/include/skycells.h (modified) (1 diff)
-
addstar/src/ConfigInit_skycells.c (modified) (1 diff)
-
addstar/src/ReadStarsUKIRT.c (modified) (1 diff)
-
addstar/src/fakeimage.c (modified) (3 diffs)
-
addstar/src/getusno.c (modified) (1 diff)
-
addstar/src/getusnob.c (modified) (1 diff)
-
addstar/src/loadsupercos_plates.c (modified) (1 diff)
-
libdvo/src/coordops.c (modified) (2 diffs)
-
libdvo/src/skyregion_gsc.c (modified) (1 diff)
-
libfits/header/F_create_H.c (modified) (1 diff)
-
libfits/header/F_modify.c (modified) (9 diffs)
-
libfits/header/F_print.c (modified) (6 diffs)
-
libfits/table/F_create_TH.c (modified) (1 diff)
-
libohana/src/findexec.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/Ohana/src/addstar/include/skycells.h
r40528 r42116 35 35 36 36 /* globals which define database info / data sources (KEEP) */ 37 char ImageCat[ 256];37 char ImageCat[512]; 38 38 char GSCFILE[256]; 39 39 char CATDIR[256]; -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/ConfigInit_skycells.c
r33719 r42116 6 6 7 7 char *config, *file; 8 char CatdirPhotcodeFile[ 256];9 char MasterPhotcodeFile[ 256];8 char CatdirPhotcodeFile[512]; 9 char MasterPhotcodeFile[512]; 10 10 11 11 /*** load configuration info ***/ -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/ReadStarsUKIRT.c
r40520 r42116 66 66 } 67 67 68 char filter[ 80];68 char filter[50]; 69 69 if (!gfits_scan (header, "FILTER", "%s", 1, filter)) { 70 70 fprintf (stderr, "missing FILTER\n"); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/fakeimage.c
r40291 r42116 7 7 double Rmin, Rmax, Dmin, Dmax; 8 8 double dX, dY, r, d; 9 char chipname[ 80], chipdata[256], name[80];9 char chipname[16], chipdata[256], name[117]; 10 10 char *config; 11 11 Image *image; … … 67 67 for (i = 0; i < Nchips; i++) { 68 68 /* this is the addstar name for the chip in the camera */ 69 s printf (chipname, "CHIP.%03d", i);69 snprintf (chipname, 16, "CHIP.%03d", i); 70 70 ScanConfig (config, chipname, "%s", 0, chipdata); 71 71 … … 74 74 75 75 /* this is the camera-specific name of a chip */ 76 s printf (name, "%s.%s", rootname, chipname);76 snprintf (name, 117, "%s.%s", rootname, chipname); 77 77 strcpy (image[i+1].name, name); 78 78 -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/getusno.c
r38986 r42116 10 10 float hours[100]; 11 11 int start[100], number[100], *buffer, *buf; 12 char filename[ 128];12 char filename[300]; 13 13 FILE *f; 14 14 int iRA0, iRA1, iDEC0, iDEC1; -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/getusnob.c
r38986 r42116 9 9 float hours[100]; 10 10 int start[100], number[100], *buffer, *buf; 11 char filename[ 128];11 char filename[300]; 12 12 FILE *f; 13 13 double dec; -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadsupercos_plates.c
r40291 r42116 77 77 image[Nimage].dMcal = 0.0; 78 78 79 char photname[ 128];80 snprintf (photname, 128, "SCOS.%s.%s", emulsion, filterID);79 char photname[300]; 80 snprintf (photname, 300, "SCOS.%s.%s", emulsion, filterID); 81 81 image[Nimage].photcode = GetPhotcodeCodebyName (photname); 82 82 if (!image[Nimage].photcode) { -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/coordops.c
r42075 r42116 888 888 889 889 int OldAIPS; 890 char csys[16], ctype[ 16];890 char csys[16], ctype[32]; 891 891 double rotate, Lambda; 892 892 … … 906 906 if (!strncmp (coords[0].ctype, "SLAT", 4)) strcpy (csys, "SLON"); 907 907 if (!strcmp (csys, "NONE")) return (FALSE); 908 snprintf (ctype, 16, "%s-%s", csys, &coords[0].ctype[5]);908 snprintf (ctype, 32, "%s-%s", csys, &coords[0].ctype[5]); 909 909 gfits_modify (header, "CTYPE1", "%s", 1, ctype); 910 910 } -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/skyregion_gsc.c
r41738 r42116 247 247 int i; 248 248 double Rmin, Rmax, Dmin, Dmax; 249 char temp[ 80], name[80];249 char temp[50], name[80]; 250 250 SkyTable *band; 251 251 SkyRegion *regions; -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/header/F_create_H.c
r34577 r42116 12 12 13 13 ALLOCATE (header[0].buffer, char, NBYTES); 14 bzero (header[0].buffer, NBYTES); 14 15 15 for (i = 0; i < NBYTES; i++) 16 header[0].buffer[i] = ' '; 17 strncpy (header[0].buffer, "END", 3); 16 for (i = 0; i < NBYTES; i++) header[0].buffer[i] = ' '; 17 strcpy (header[0].buffer, "END"); 18 18 19 19 gfits_modify_alt (header, "SIMPLE", "%t", 1, header[0].simple); -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/header/F_modify.c
r38441 r42116 8 8 /* this function is extremely similar to gfits_print, except it allows for changing an existing field. */ 9 9 10 char comment[82], string[82], data[82]; 10 // the output string needs to be long enough to keep the compiler from 11 // complaining, even though the string cannot be more than 80 chars 12 char comment[82], string[200], data[82]; 11 13 char *p, *qe; 12 14 va_list argp; … … 14 16 va_start (argp, N); 15 17 bzero (data, 82); 16 bzero (string, 82);18 bzero (string, 200); 17 19 bzero (comment, 82); 18 20 … … 51 53 52 54 /* write the numeric modes */ 53 if (!strcmp (mode, "%d")) { snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); goto found_it; }54 if (!strcmp (mode, "%ld")) { snprintf (string, 81, "%-8s= %20ld / %-s ", field, va_arg (argp, long), comment); goto found_it; }55 if (!strcmp (mode, "%lld")) { snprintf (string, 81, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); goto found_it; }56 if (!strcmp (mode, "%Ld")) { snprintf (string, 81, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); goto found_it; }57 if (!strcmp (mode, "%u")) { snprintf (string, 81, "%-8s= %20u / %-s ", field, va_arg (argp, unsigned), comment); goto found_it; }58 if (!strcmp (mode, "%lu")) { snprintf (string, 81, "%-8s= %20lu / %-s ", field, va_arg (argp, unsigned long), comment); goto found_it; }59 if (!strcmp (mode, "%llu")) { snprintf (string, 81, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; }60 if (!strcmp (mode, "%Lu")) { snprintf (string, 81, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; }61 if (!strcmp (mode, "%hd")) { snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); goto found_it; }62 if (!strcmp (mode, "%f")) { snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); goto found_it; }63 if (!strcmp (mode, "%lf")) { snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); goto found_it; }64 if (!strcmp (mode, "%e")) { snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); goto found_it; }65 if (!strcmp (mode, "%le")) { snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); goto found_it; }66 if (!strcmp (mode, "%g")) { snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); goto found_it; }67 if (!strcmp (mode, "%lg")) { snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); goto found_it; }68 if (!strcmp (mode, "%jd")) { snprintf (string, 81, "%-8s= %20jd / %-s ", field, va_arg (argp, intmax_t), comment); goto found_it; }55 if (!strcmp (mode, "%d")) { snprintf (string, 200, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); goto found_it; } 56 if (!strcmp (mode, "%ld")) { snprintf (string, 200, "%-8s= %20ld / %-s ", field, va_arg (argp, long), comment); goto found_it; } 57 if (!strcmp (mode, "%lld")) { snprintf (string, 200, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); goto found_it; } 58 if (!strcmp (mode, "%Ld")) { snprintf (string, 200, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); goto found_it; } 59 if (!strcmp (mode, "%u")) { snprintf (string, 200, "%-8s= %20u / %-s ", field, va_arg (argp, unsigned), comment); goto found_it; } 60 if (!strcmp (mode, "%lu")) { snprintf (string, 200, "%-8s= %20lu / %-s ", field, va_arg (argp, unsigned long), comment); goto found_it; } 61 if (!strcmp (mode, "%llu")) { snprintf (string, 200, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; } 62 if (!strcmp (mode, "%Lu")) { snprintf (string, 200, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; } 63 if (!strcmp (mode, "%hd")) { snprintf (string, 200, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); goto found_it; } 64 if (!strcmp (mode, "%f")) { snprintf (string, 200, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); goto found_it; } 65 if (!strcmp (mode, "%lf")) { snprintf (string, 200, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); goto found_it; } 66 if (!strcmp (mode, "%e")) { snprintf (string, 200, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); goto found_it; } 67 if (!strcmp (mode, "%le")) { snprintf (string, 200, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); goto found_it; } 68 if (!strcmp (mode, "%g")) { snprintf (string, 200, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); goto found_it; } 69 if (!strcmp (mode, "%lg")) { snprintf (string, 200, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); goto found_it; } 70 if (!strcmp (mode, "%jd")) { snprintf (string, 200, "%-8s= %20jd / %-s ", field, va_arg (argp, intmax_t), comment); goto found_it; } 69 71 70 72 /* string value. Quotes must be at least 8 chars apart */ … … 73 75 if (!ptr) goto invalid; 74 76 strncpy (data, ptr, 68); 75 snprintf (string, 81, "%-8s= '%-8s' / %-s ", field, data, comment);77 snprintf (string, 200, "%-8s= '%-8s' / %-s ", field, data, comment); 76 78 goto found_it; 77 79 } … … 94 96 /* this function is extremely similar to gfits_print, except it allows for changing an existing field. */ 95 97 96 char comment[82], string[ 82], data[82];98 char comment[82], string[200], data[82]; 97 99 char *p, *qs, *qe; 98 100 va_list argp; … … 100 102 va_start (argp, N); 101 103 bzero (data, 82); 102 bzero (string, 82);103 104 bzero (comment, 82); 105 bzero (string, 200); 104 106 105 107 if (mode[0] != '%') { … … 139 141 if (!strcmp (mode, "%t")) { 140 142 if (va_arg (argp, int)) 141 snprintf (string, 81, "%-8s= %18s T / %-s ", field, " ", comment);143 snprintf (string, 200, "%-8s= %18s T / %-s ", field, " ", comment); 142 144 else 143 snprintf (string, 81, "%-8s= %18s F / %-s ", field, " ", comment);145 snprintf (string, 200, "%-8s= %18s F / %-s ", field, " ", comment); 144 146 } 145 147 … … 149 151 if (!ptr) goto invalid; 150 152 strncpy (data, ptr, 71); 151 snprintf (string, 81, "%-8s %-71s", field, data);153 snprintf (string, 200, "%-8s %-71s", field, data); 152 154 } 153 155 … … 167 169 strncpy (comment, ptr, 80); 168 170 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ 169 snprintf (string, 81, "%-8s= %s / %-s", field, data, comment);171 snprintf (string, 200, "%-8s= %s / %-s", field, data, comment); 170 172 /* this will keep the original line, but truncate the comment */ 171 173 } -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/header/F_print.c
r34577 r42116 8 8 9 9 static char blank[] = " "; 10 char string[ 82], line[80];10 char string[200], line[80]; 11 11 char *p; 12 12 va_list argp; … … 46 46 47 47 /* write the numeric modes */ 48 if (!strcmp (mode, "%d")) { snprintf (string, 81, "%-8s= %20d / %46s ", field, va_arg (argp, int), blank); goto found_it; }49 if (!strcmp (mode, "%ld")) { snprintf (string, 81, "%-8s= %20ld / %46s ", field, va_arg (argp, long), blank); goto found_it; }50 if (!strcmp (mode, "%lld")){ snprintf (string, 81, "%-8s= %20lld / %46s ", field, va_arg (argp, long long), blank); goto found_it; }51 if (!strcmp (mode, "%Ld")) { snprintf (string, 81, "%-8s= %20lld / %46s ", field, va_arg (argp, long long), blank); goto found_it; }52 if (!strcmp (mode, "%u")) { snprintf (string, 81, "%-8s= %20u / %46s ", field, va_arg (argp, unsigned), blank); goto found_it; }53 if (!strcmp (mode, "%lu")) { snprintf (string, 81, "%-8s= %20lu / %46s ", field, va_arg (argp, unsigned long), blank); goto found_it; }54 if (!strcmp (mode, "%llu")){ snprintf (string, 81, "%-8s= %20llu / %46s ", field, va_arg (argp, unsigned long long), blank); goto found_it; }55 if (!strcmp (mode, "%Lu")) { snprintf (string, 81, "%-8s= %20llu / %46s ", field, va_arg (argp, unsigned long long), blank); goto found_it; }56 if (!strcmp (mode, "%hd")) { snprintf (string, 81, "%-8s= %20d / %46s ", field, va_arg (argp, int), blank); goto found_it; }57 if (!strcmp (mode, "%f")) { snprintf (string, 81, "%-8s= %20.10f / %46s ", field, va_arg (argp, double), blank); goto found_it; }58 if (!strcmp (mode, "%lf")) { snprintf (string, 81, "%-8s= %20.10f / %46s ", field, va_arg (argp, double), blank); goto found_it; }59 if (!strcmp (mode, "%e")) { snprintf (string, 81, "%-8s= %20.10E / %46s ", field, va_arg (argp, double), blank); goto found_it; }60 if (!strcmp (mode, "%le")) { snprintf (string, 81, "%-8s= %20.10E / %46s ", field, va_arg (argp, double), blank); goto found_it; }61 if (!strcmp (mode, "%g")) { snprintf (string, 81, "%-8s= %20.10G / %46s ", field, va_arg (argp, double), blank); goto found_it; }62 if (!strcmp (mode, "%lg")) { snprintf (string, 81, "%-8s= %20.10G / %46s ", field, va_arg (argp, double), blank); goto found_it; }63 if (!strcmp (mode, "%jd")) { snprintf (string, 81, "%-8s= %20jd / %46s ", field, va_arg (argp, intmax_t), blank); goto found_it; }48 if (!strcmp (mode, "%d")) { snprintf (string, 200, "%-8s= %20d / %46s ", field, va_arg (argp, int), blank); goto found_it; } 49 if (!strcmp (mode, "%ld")) { snprintf (string, 200, "%-8s= %20ld / %46s ", field, va_arg (argp, long), blank); goto found_it; } 50 if (!strcmp (mode, "%lld")){ snprintf (string, 200, "%-8s= %20lld / %46s ", field, va_arg (argp, long long), blank); goto found_it; } 51 if (!strcmp (mode, "%Ld")) { snprintf (string, 200, "%-8s= %20lld / %46s ", field, va_arg (argp, long long), blank); goto found_it; } 52 if (!strcmp (mode, "%u")) { snprintf (string, 200, "%-8s= %20u / %46s ", field, va_arg (argp, unsigned), blank); goto found_it; } 53 if (!strcmp (mode, "%lu")) { snprintf (string, 200, "%-8s= %20lu / %46s ", field, va_arg (argp, unsigned long), blank); goto found_it; } 54 if (!strcmp (mode, "%llu")){ snprintf (string, 200, "%-8s= %20llu / %46s ", field, va_arg (argp, unsigned long long), blank); goto found_it; } 55 if (!strcmp (mode, "%Lu")) { snprintf (string, 200, "%-8s= %20llu / %46s ", field, va_arg (argp, unsigned long long), blank); goto found_it; } 56 if (!strcmp (mode, "%hd")) { snprintf (string, 200, "%-8s= %20d / %46s ", field, va_arg (argp, int), blank); goto found_it; } 57 if (!strcmp (mode, "%f")) { snprintf (string, 200, "%-8s= %20.10f / %46s ", field, va_arg (argp, double), blank); goto found_it; } 58 if (!strcmp (mode, "%lf")) { snprintf (string, 200, "%-8s= %20.10f / %46s ", field, va_arg (argp, double), blank); goto found_it; } 59 if (!strcmp (mode, "%e")) { snprintf (string, 200, "%-8s= %20.10E / %46s ", field, va_arg (argp, double), blank); goto found_it; } 60 if (!strcmp (mode, "%le")) { snprintf (string, 200, "%-8s= %20.10E / %46s ", field, va_arg (argp, double), blank); goto found_it; } 61 if (!strcmp (mode, "%g")) { snprintf (string, 200, "%-8s= %20.10G / %46s ", field, va_arg (argp, double), blank); goto found_it; } 62 if (!strcmp (mode, "%lg")) { snprintf (string, 200, "%-8s= %20.10G / %46s ", field, va_arg (argp, double), blank); goto found_it; } 63 if (!strcmp (mode, "%jd")) { snprintf (string, 200, "%-8s= %20jd / %46s ", field, va_arg (argp, intmax_t), blank); goto found_it; } 64 64 65 65 /* string value. Quotes must be at least 8 chars apart. Longer lines will this should be fixed to allow arbitrary string lengths, up to 69 chars */ … … 69 69 strcpy (line, ptr); 70 70 line[68] = 0; 71 snprintf (string, 81, "%-8s= '%-8s' / %46s ", field, line, blank);71 snprintf (string, 200, "%-8s= '%-8s' / %46s ", field, line, blank); 72 72 goto found_it; 73 73 } … … 89 89 90 90 static char blank[] = " "; 91 char string[ 82], line[80];91 char string[200], line[80]; 92 92 char *p, a; 93 93 va_list argp; … … 126 126 a = va_arg (argp, int); 127 127 if (a == 1) 128 snprintf (string, 81, "%-8s= %18s T / %46s ", field, blank, blank);128 snprintf (string, 200, "%-8s= %18s T / %46s ", field, blank, blank); 129 129 else 130 snprintf (string, 81, "%-8s= %18s F / %46s ", field, blank, blank);130 snprintf (string, 200, "%-8s= %18s F / %46s ", field, blank, blank); 131 131 } 132 132 … … 138 138 bzero (line, 80); 139 139 strncpy (line, ptr, 71); 140 snprintf (string, 81, "%-8s %-71s", field, line);140 snprintf (string, 200, "%-8s %-71s", field, line); 141 141 } 142 142 -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/table/F_create_TH.c
r38989 r42116 17 17 myAssert (!header->buffer, "failed to init header or free buffer?"); 18 18 ALLOCATE (header[0].buffer, char, NBYTES); 19 bzero (header[0].buffer, NBYTES); 19 20 20 for (i = 0; i < NBYTES; i++) 21 header[0].buffer[i] = ' '; 22 strncpy (header[0].buffer, "END", 3); 21 for (i = 0; i < NBYTES; i++) header[0].buffer[i] = ' '; 22 strcpy (header[0].buffer, "END"); 23 23 24 24 gfits_modify (header, "XTENSION", "%s", 1, type); -
branches/eam_branches/ipp-20220316/Ohana/src/libohana/src/findexec.c
r39457 r42116 259 259 260 260 int i, N, done, status; 261 char *c, *e, *dir, path[1024], name[1 024];261 char *c, *e, *dir, path[1024], name[1280]; 262 262 263 263 /* if given an absolute or relative path, use it */ … … 295 295 e = strchr (c, ':'); 296 296 } 297 snprintf (name, 10 24, "%s/%s", path, argv[0]);297 snprintf (name, 1080, "%s/%s", path, argv[0]); 298 298 status = check_file_exec (name); 299 299
Note:
See TracChangeset
for help on using the changeset viewer.
