Skip to content

Commit

Permalink
time_funcs include and dependency adjustments
Browse files Browse the repository at this point in the history
Fix dependency typo in the Makefile

Remove config.h from hts_time_funcs.h as it's likely to be too
late to include it by the time that file it read.  Add config.h
include to test/test_time_funcs.c instead.

Add extra includes to hts_time_funcs.h so it stands on its own
and doesn't rely on the right headers having been included before
it is.
  • Loading branch information
daviesrob authored and whitwham committed Jul 19, 2022
1 parent 9562aeb commit c72eee6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ bcf_sr_sort_h = bcf_sr_sort.h $(htslib_synced_bcf_reader_h) $(htslib_kbitset_h)
header_h = header.h cram/string_alloc.h cram/pooled_alloc.h $(htslib_khash_h) $(htslib_kstring_h) $(htslib_sam_h)
hfile_internal_h = hfile_internal.h $(htslib_hts_defs_h) $(htslib_hfile_h) $(textutils_internal_h)
hts_internal_h = hts_internal.h $(htslib_hts_h) $(textutils_internal_h)
hts_time_funcs_h = hts_time_funcs.h config.h
hts_time_funcs_h = hts_time_funcs.h
sam_internal_h = sam_internal.h $(htslib_sam_h)
textutils_internal_h = textutils_internal.h $(htslib_kstring_h)
thread_pool_internal_h = thread_pool_internal.h $(htslib_thread_pool_h)
Expand Down Expand Up @@ -726,7 +726,7 @@ test/test-parse-reg.o: test/test-parse-reg.c config.h $(htslib_hts_h) $(htslib_s
test/test_realn.o: test/test_realn.c config.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h)
test/test-regidx.o: test/test-regidx.c config.h $(htslib_kstring_h) $(htslib_regidx_h) $(htslib_hts_defs_h) $(textutils_internal_h)
test/test_str2int.o: test/test_str2int.c config.h $(textutils_internal_h)
test/test_time_funcs.o: test/test_time_funcs.c $(htslib_time_funcs_h)
test/test_time_funcs.o: test/test_time_funcs.c config.h $(hts_time_funcs_h)
test/test_view.o: test/test_view.c config.h $(cram_h) $(htslib_sam_h) $(htslib_vcf_h) $(htslib_hts_log_h)
test/test_index.o: test/test_index.c config.h $(htslib_sam_h) $(htslib_vcf_h)
test/test-vcf-api.o: test/test-vcf-api.c config.h $(htslib_hts_h) $(htslib_vcf_h) $(htslib_kstring_h) $(htslib_kseq_h)
Expand Down
5 changes: 4 additions & 1 deletion hts_time_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ DEALINGS IN THE SOFTWARE. */
Non-derived code is copyright as above.
*/

#include <config.h>
#include <stdint.h>
#include <limits.h>
#include <errno.h>
#include <time.h>

static inline int hts_time_normalise(int *tens, int *units, int base) {
if (*units < 0 || *units >= base) {
Expand Down
1 change: 1 addition & 0 deletions test/test_time_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. */

#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
Expand Down

0 comments on commit c72eee6

Please sign in to comment.