Skip to content

Two protected areas in Stream.h #6146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SummerSun opened this issue Apr 3, 2017 · 3 comments
Closed

Two protected areas in Stream.h #6146

SummerSun opened this issue Apr 3, 2017 · 3 comments

Comments

@SummerSun
Copy link

SummerSun commented Apr 3, 2017

Is it a typo? The first one should be private according to the comments.

class Stream : public Print
{

protected:

    unsigned long _timeout;      // number of milliseconds to wait......
    unsigned long _startMillis;  // used for timeout measurement
    int timedRead();    // private method to read stream with timeout
    int timedPeek();    // private method to peek stream with timeout
public:
....
...

protected:

        long parseInt(char skipChar); // as above but the given skipChar is ignored
        // as above but the given skipChar is ignored
        // this allows format characters (typically commas) in values to be ignored

        float parseFloat(char skipChar);  // as above but the given skipChar is ignored
@cousteaulecommandant
Copy link
Contributor

cousteaulecommandant commented May 29, 2017

This is intentional. Apparently it used to be private, but it was changed to protected for optimization reasons (see 99f2a27).
Maybe the comments should have been changed accordingly though.

Tip: use the Blame button when browsing a file on Github (https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/Stream.h) to see which was the last commit to affect each line of the file.

@matthijskooijman
Copy link
Collaborator

So the only change needed is to fix the comments. @cmaglie, perhaps you could fix this? Or make me collaborator on the sam/samd repositories too so I can push a simple fix?

cmaglie pushed a commit that referenced this issue Jul 6, 2017
…rotected

These functions were changed from private to protected in 99f2a27 but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves #6146.
@per1234
Copy link
Collaborator

per1234 commented Jul 18, 2017

@per1234 per1234 closed this as completed Jul 18, 2017
akshmakov pushed a commit to akshmakov/Arduino that referenced this issue Aug 2, 2017
…rotected

These functions were changed from private to protected in arduino@99f2a27 but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves arduino#6146.
facchinm pushed a commit to arduino/ArduinoCore-avr that referenced this issue Sep 20, 2017
…rotected

These functions were changed from private to protected in arduino/Arduino@99f2a27 but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves arduino/Arduino#6146.
facchinm pushed a commit to arduino/ArduinoCore-avr that referenced this issue Sep 20, 2017
…rotected

These functions were changed from private to protected in arduino/Arduino@99f2a27 but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves arduino/Arduino#6146.
facchinm pushed a commit to arduino/ArduinoCore-avr that referenced this issue Sep 20, 2017
…rotected

These functions were changed from private to protected in arduino/Arduino@99f2a27 but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves arduino/Arduino#6146.
facchinm pushed a commit to arduino/ArduinoCore-avr that referenced this issue Sep 20, 2017
…rotected

These functions were changed from private to protected in arduino/Arduino@99f2a27 but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves arduino/Arduino#6146.
facchinm pushed a commit to arduino/ArduinoCore-avr that referenced this issue Sep 20, 2017
…rotected

These functions were changed from private to protected in arduino/Arduino@99f2a27 but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves arduino/Arduino#6146.
rickyrockrat pushed a commit to rickyrockrat/Arduino.hardware that referenced this issue Apr 10, 2018
…rotected

These functions were changed from private to protected in arduino/Arduino@99f2a27 but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino SAM Boards and Arduino SAMD Boards, solves arduino/Arduino#6146.
ollie1400 pushed a commit to ollie1400/Arduino that referenced this issue May 2, 2022
…rotected

These functions were changed from private to protected but the comments were not updated at that time.

In conjunction with equivalent pull requests to Arduino AVR Boards and Arduino SAMD Boards, solves arduino#6146.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants