mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
patches for Linux from Aldy Hernandez
This commit is contained in:
@@ -19,9 +19,10 @@
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
CFLAGS=-g -W -Wall -Werror -ansi -pedantic
|
||||
CFLAGS=-g -W -Wall -Werror -ansi -pedantic -std=c99
|
||||
CMDS=ptdl ptpk ptunpk cpint
|
||||
LIBS=../lib/libgc.a
|
||||
LIBRARIES=-lm
|
||||
INCLUDES=-I../lib
|
||||
|
||||
all: $(CMDS)
|
||||
@@ -34,16 +35,16 @@ clean:
|
||||
$(CC) -c $(CFLAGS) $(INCLUDES) $<
|
||||
|
||||
cpint: cpint.o $(LIBS)
|
||||
$(CXX) -o $@ $^
|
||||
$(CXX) -o $@ $^ $(LIBRARIES)
|
||||
|
||||
ptdl: ptdl.o $(LIBS)
|
||||
$(CC) -o $@ $^
|
||||
$(CC) -o $@ $^ $(LIBRARIES)
|
||||
|
||||
ptunpk: ptunpk.o $(LIBS)
|
||||
$(CC) -o $@ $^
|
||||
$(CC) -o $@ $^ $(LIBRARIES)
|
||||
|
||||
ptpk: ptpk.o $(LIBS)
|
||||
$(CC) -o $@ $^
|
||||
$(CC) -o $@ $^ $(LIBRARIES)
|
||||
|
||||
ptdl.o: ../lib/pt.h
|
||||
ptunpk.o: ../lib/pt.h
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "pt.h"
|
||||
|
||||
void
|
||||
@@ -116,9 +115,11 @@ pt_pack(FILE *in, FILE *out, int wheel_sz_mm, int rec_int)
|
||||
hr = atoi(line + rider_pmatch[10].rm_so);
|
||||
interval = atoi(line + rider_pmatch[11].rm_so);
|
||||
if (mins - last_mins - 0.021 > 1.0 / 60.0) {
|
||||
struct tm *tm_p;
|
||||
inc_time = start_time + round((mins - 0.021000001) * 60.0);
|
||||
if (!localtime_r(&inc_time, &inc_tm))
|
||||
assert(0);
|
||||
tm_p = localtime(&inc_time);
|
||||
assert(tm_p);
|
||||
inc_tm = *tm_p;
|
||||
pt_pack_time(buf, &inc_tm);
|
||||
pt_write_data(out, buf);
|
||||
pt_pack_config(buf, interval, rec_int, wheel_sz_mm);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
CFLAGS=-g -W -Wall -Werror -ansi -pedantic
|
||||
CFLAGS=-g -W -Wall -Werror -ansi -pedantic -std=c99
|
||||
LIBTOOL=libtool
|
||||
|
||||
all: libgc.a
|
||||
@@ -31,3 +31,5 @@ clean:
|
||||
libgc.a: pt.o cpint.o
|
||||
$(LIBTOOL) -static -o $@ $^
|
||||
|
||||
pt.o: pt.h
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ cpi_files_to_update(const char *dir)
|
||||
assert(0);
|
||||
|
||||
dirp = opendir(dir);
|
||||
assert(dirp);
|
||||
while ((dp = readdir(dirp)) != NULL) {
|
||||
int nmatch = 7;
|
||||
regmatch_t *pmatch = (regmatch_t*) calloc(nmatch, sizeof(regmatch_t));
|
||||
@@ -302,6 +303,7 @@ combine_cpi_files(const char *dir, double *bests[], int *bestlen)
|
||||
*bests = calloc(*bestlen, sizeof(double));
|
||||
inname = malloc(strlen(dir) + 25);
|
||||
dirp = opendir(dir);
|
||||
assert(dirp);
|
||||
while ((dp = readdir(dirp)) != NULL) {
|
||||
if (strcmp(".cpi", dp->d_name + dp->d_namlen - 4) == 0) {
|
||||
sprintf(inname, "%s/%s", dir, dp->d_name);
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#define PT_DEBUG_NONE 0
|
||||
#define PT_DEBUG_MAX 1
|
||||
|
||||
Reference in New Issue
Block a user