From c01d057d7b97dda8057352493b0fcdb77d96db57 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 16 Sep 2015 21:47:41 -0700 Subject: [PATCH] Counter: Explicitly call mode constructor. This is a compiler bug workaround. On gcc 4.8.2, the default argument to the Counter(Mode) constructor is not recognized as a valid delegating constructor to use. Change-Id: I616453567c45ce523e14345bd667ea893bf219a3 --- wpilibc/wpilibC++Devices/src/Counter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wpilibc/wpilibC++Devices/src/Counter.cpp b/wpilibc/wpilibC++Devices/src/Counter.cpp index 6532b67595..55a2a94e96 100644 --- a/wpilibc/wpilibC++Devices/src/Counter.cpp +++ b/wpilibc/wpilibC++Devices/src/Counter.cpp @@ -50,7 +50,7 @@ DEPRECATED( "Raw pointers are deprecated; if you just want to construct a Counter with " "its own DigitalSource, then call the Counter(int channel). If you want to " "keep your own copy of the DigitalSource, use std::shared_ptr.") -Counter::Counter(DigitalSource *source) : Counter() { +Counter::Counter(DigitalSource *source) : Counter(kTwoPulse) { SetUpSource(source); ClearDownSource(); } @@ -67,7 +67,7 @@ Counter::Counter(DigitalSource *source) : Counter() { * @param source A pointer to the existing DigitalSource object. It will be * set as the Up Source. */ -Counter::Counter(std::shared_ptr source) : Counter() { +Counter::Counter(std::shared_ptr source) : Counter(kTwoPulse) { SetUpSource(source); ClearDownSource(); } @@ -80,7 +80,7 @@ Counter::Counter(std::shared_ptr source) : Counter() { * @param channel The DIO channel to use as the up source. 0-9 are on-board, * 10-25 are on the MXP */ -Counter::Counter(int32_t channel) : Counter() { +Counter::Counter(int32_t channel) : Counter(kTwoPulse) { SetUpSource(channel); ClearDownSource(); } @@ -95,7 +95,7 @@ Counter::Counter(int32_t channel) : Counter() { */ DEPRECATED( "Raw pointers are deprecated. Use pass-by-reference instead.") -Counter::Counter(AnalogTrigger *trigger) : Counter() { +Counter::Counter(AnalogTrigger *trigger) : Counter(kTwoPulse) { SetUpSource(trigger->CreateOutput(kState)); ClearDownSource(); } @@ -108,7 +108,7 @@ Counter::Counter(AnalogTrigger *trigger) : Counter() { * The counter will start counting immediately. * @param trigger The reference to the existing AnalogTrigger object. */ -Counter::Counter(const AnalogTrigger &trigger) : Counter() { +Counter::Counter(const AnalogTrigger &trigger) : Counter(kTwoPulse) { SetUpSource(trigger.CreateOutput(kState)); ClearDownSource(); }