mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
converted to C++/qmake
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
#
|
||||
# $Id: Makefile,v 1.11 2006/09/06 23:23:03 srhea Exp $
|
||||
#
|
||||
# Copyright (c) 2006 Sean C. Rhea (srhea@srhea.net)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the Free
|
||||
# Software Foundation; either version 2 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
# more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
CC=gcc
|
||||
CFLAGS=-g -W -Wall -Werror -ansi -pedantic -std=c99 -D_BSD_SOURCE
|
||||
LIBTOOL=libtool
|
||||
|
||||
all: libgc.a
|
||||
.PHONY: all clean
|
||||
|
||||
clean:
|
||||
rm -f *.o libgc.a
|
||||
|
||||
libgc.a: pt.o # cpint.o
|
||||
rm -f $@
|
||||
ar q $@ $^
|
||||
|
||||
pt.o: pt.h
|
||||
|
||||
14
src/lib/lib.pro
Normal file
14
src/lib/lib.pro
Normal file
@@ -0,0 +1,14 @@
|
||||
######################################################################
|
||||
# Automatically generated by qmake (2.01a) Fri Sep 14 16:49:39 2007
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = lib
|
||||
TARGET = gc
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
CONFIG += static
|
||||
|
||||
# Input
|
||||
HEADERS += pt.h
|
||||
SOURCES += pt.cpp
|
||||
|
||||
@@ -67,7 +67,7 @@ pt_find_device(char *result[], int capacity)
|
||||
dirp = opendir("/dev");
|
||||
while ((count < capacity) && ((dp = readdir(dirp)) != NULL)) {
|
||||
if (regexec(®, dp->d_name, 0, NULL, 0) == 0) {
|
||||
result[count] = malloc(6 + strlen(dp->d_name));
|
||||
result[count] = (char*) malloc(6 + strlen(dp->d_name));
|
||||
sprintf(result[count], "/dev/%s", dp->d_name);
|
||||
++count;
|
||||
}
|
||||
@@ -521,14 +521,14 @@ pt_pack_data(unsigned char *buf, unsigned wheel_sz_mm, double nm,
|
||||
double mph, double miles, unsigned cad, unsigned hr)
|
||||
{
|
||||
double rotations = miles / BAD_KM_TO_MI * 1000.00 * 1000.0 / wheel_sz_mm;
|
||||
unsigned inlbs = round(nm / BAD_LBFIN_TO_NM_2);
|
||||
unsigned inlbs = (unsigned) round(nm / BAD_LBFIN_TO_NM_2);
|
||||
double kph10 = mph * 10.0 / BAD_KM_TO_MI;
|
||||
unsigned speed;
|
||||
if (mph == -1.0)
|
||||
speed = 0xfff;
|
||||
else
|
||||
speed = round(MAGIC_CONSTANT / kph10);
|
||||
buf[0] = 0x80 | check(round(rotations));
|
||||
speed = (unsigned) round(MAGIC_CONSTANT / kph10);
|
||||
buf[0] = 0x80 | check((unsigned) round(rotations));
|
||||
buf[1] = ((inlbs & 0xf00) >> 4) | ((speed & 0xf00) >> 8);
|
||||
buf[2] = inlbs & 0xff;
|
||||
buf[3] = speed & 0xff;
|
||||
Reference in New Issue
Block a user