Skip to content

int -> int32_t #3

Open
Open

Description

@parthmittal

to make code more portable, we should use library define types.
This is annoying, someone will have to refactor every single file we have.

Activity

  1. jailuthra commented on Mar 25, 2016

    @jailuthra
    Member

    Here's the grep output for all files matching the regex (^|\s)int\s

    arduino/ultrasonic/ultrasonic.ino:const int echoPin = 7; // Echo Pin
    arduino/ultrasonic/ultrasonic.ino:const int trigPin = 8; // Trigger Pin
    arduino/ultrasonic/ultrasonic.ino:const int LEDPin = 13;// connected LED
    arduino/ultrasonic/ultrasonic.ino:const int maximumRange = 4; // Maximum range of sensor in metres
    arduino/ultrasonic/ultrasonic.ino:const int minimumRange = 0; // Minimum range needed
    arduino/ultrasonic/ultrasonic.ino:const int speedofSound = 336; //constant in m/s
    arduino/ultrasonic/ultrasonic.ino:int id = 0;
    arduino/ultrasonic/ultrasonic.ino:int writeString (String buffer, int len);
    arduino/ultrasonic/ultrasonic.ino:int connectWiFi();
    arduino/ultrasonic/ultrasonic.ino:int connectServer();
    arduino/ultrasonic/ultrasonic.ino:  int temp;
    arduino/ultrasonic/ultrasonic.ino:int connectWiFi() {
    arduino/ultrasonic/ultrasonic.ino:int moduleWorking() {
    arduino/ultrasonic/ultrasonic.ino:int connectServer() {
    arduino/ultrasonic/ultrasonic.ino:int writeString (String buffer, int len) {
    arduino/ultrasonic/ultrasonic.ino:    int state = HIGH;
    arduino/ultrasonic/ultrasonic.ino:    int toggle = HIGH ^ LOW;
    arduino/ultrasonic/ultrasonic.ino:    int state = HIGH;
    arduino/ultrasonic/ultrasonic.ino:    int toggle = HIGH ^ LOW;
    arduino/ultrasonic/ultrasonic.ino:    int state = HIGH;
    arduino/ultrasonic/ultrasonic.ino:    int toggle = HIGH ^ LOW;
    arduino/ultrasonic/ultrasonic.ino:int findOK() {
    arduino/ultrasonic/ultrasonic.ino:  int index = 0;
    arduino/ultrasonic/ultrasonic.ino:  int foundOK = 0;
    bot_stuff/bot_test/Error.cpp:void errorLED(errorType error, int LEDPin) {
    bot_stuff/bot_test/Error.cpp:        int state = HIGH;
    bot_stuff/bot_test/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_test/Error.cpp:        int state = HIGH;
    bot_stuff/bot_test/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_test/Error.cpp:        int state = HIGH;
    bot_stuff/bot_test/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_test/Sensor.cpp:    int i;
    bot_stuff/bot_test/Constants.h:const int AL = 2;
    bot_stuff/bot_test/Constants.h:const int BL = 3;
    bot_stuff/bot_test/Constants.h:const int AR = 4;
    bot_stuff/bot_test/Constants.h:const int BR = 5;
    bot_stuff/bot_test/Constants.h:const int encL = 6;
    bot_stuff/bot_test/Constants.h:const int encR = 7;
    bot_stuff/bot_test/Constants.h:const int numSlits = 30;
    bot_stuff/bot_test/Constants.h:const int numSens = 8; // number of sensors used
    bot_stuff/bot_test/Constants.h:const int clockPin = 12;
    bot_stuff/bot_test/Constants.h:const int latchPin = 11;
    bot_stuff/bot_test/Constants.h:const int dataPin = 10;
    bot_stuff/bot_test/Constants.h:const int echoPin = 8;
    bot_stuff/bot_test/Constants.h:const int servoPin = 9;
    bot_stuff/bot_test/Error.h:void errorLED(errorType errorCode, int LEDPin);
    bot_stuff/bot_movement/Error.cpp:void errorLED(errorType error, int LEDPin) {
    bot_stuff/bot_movement/Error.cpp:        int state = HIGH;
    bot_stuff/bot_movement/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_movement/Error.cpp:        int state = HIGH;
    bot_stuff/bot_movement/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_movement/Error.cpp:        int state = HIGH;
    bot_stuff/bot_movement/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_movement/bot_movement.ino:    int reqPulses = dist / distPerPulse;
    bot_stuff/bot_movement/bot_movement.ino:    int numPulses = 0;
    bot_stuff/bot_movement/bot_movement.ino:        int initValue = digitalRead(encL);
    bot_stuff/bot_movement/bot_movement.ino:        int currValue;
    bot_stuff/bot_movement/Sensor.cpp:    int i;
    bot_stuff/bot_movement/Constants.h:const int AL = 2;
    bot_stuff/bot_movement/Constants.h:const int BL = 3;
    bot_stuff/bot_movement/Constants.h:const int AR = 4;
    bot_stuff/bot_movement/Constants.h:const int BR = 5;
    bot_stuff/bot_movement/Constants.h:const int encL = 6;
    bot_stuff/bot_movement/Constants.h:const int encR = 7;
    bot_stuff/bot_movement/Constants.h:const int numSlits = 30;
    bot_stuff/bot_movement/Constants.h:const int numSens = 8; // number of sensors used
    bot_stuff/bot_movement/Constants.h:const int clockPin = 12;
    bot_stuff/bot_movement/Constants.h:const int latchPin = 11;
    bot_stuff/bot_movement/Constants.h:const int dataPin = 10;
    bot_stuff/bot_movement/Constants.h:const int echoPin = 8;
    bot_stuff/bot_movement/Constants.h:const int servoPin = 9;
    bot_stuff/bot_movement/Error.h:void errorLED(errorType errorCode, int LEDPin);
    bot_stuff/bot_sensor/Error.cpp:void errorLED(errorType error, int LEDPin) {
    bot_stuff/bot_sensor/Error.cpp:        int state = HIGH;
    bot_stuff/bot_sensor/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_sensor/Error.cpp:        int state = HIGH;
    bot_stuff/bot_sensor/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_sensor/Error.cpp:        int state = HIGH;
    bot_stuff/bot_sensor/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/bot_sensor/bot_sensor.ino:    int i;
    bot_stuff/bot_sensor/Sensor.cpp:    int i;
    bot_stuff/bot_sensor/Constants.h:const int AL = 2;
    bot_stuff/bot_sensor/Constants.h:const int BL = 3;
    bot_stuff/bot_sensor/Constants.h:const int AR = 4;
    bot_stuff/bot_sensor/Constants.h:const int BR = 5;
    bot_stuff/bot_sensor/Constants.h:const int encL = 6;
    bot_stuff/bot_sensor/Constants.h:const int encR = 7;
    bot_stuff/bot_sensor/Constants.h:const int numSlits = 30;
    bot_stuff/bot_sensor/Constants.h:const int numSens = 8; // number of sensors used
    bot_stuff/bot_sensor/Constants.h:const int clockPin = 12;
    bot_stuff/bot_sensor/Constants.h:const int latchPin = 11;
    bot_stuff/bot_sensor/Constants.h:const int dataPin = 10;
    bot_stuff/bot_sensor/Constants.h:const int echoPin = 8;
    bot_stuff/bot_sensor/Constants.h:const int servoPin = 9;
    bot_stuff/bot_sensor/Error.h:void errorLED(errorType errorCode, int LEDPin);
    bot_stuff/esp/Error.cpp:void errorLED(errorType error, int LEDPin) {
    bot_stuff/esp/Error.cpp:        int state = HIGH;
    bot_stuff/esp/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/esp/Error.cpp:        int state = HIGH;
    bot_stuff/esp/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/esp/Error.cpp:        int state = HIGH;
    bot_stuff/esp/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/esp/Esp.h:const int echoPin = 7; // Echo Pin
    bot_stuff/esp/Esp.h:const int trigPin = 8; // Trigger Pin
    bot_stuff/esp/Esp.h:const int LEDPin = 13;// connected LED
    bot_stuff/esp/Esp.h:const int maximumRange = 4; // Maximum range of sensor in metres
    bot_stuff/esp/Esp.h:const int minimumRange = 0; // Minimum range needed
    bot_stuff/esp/Esp.h:const int speedofSound = 336; //constant in m/s
    bot_stuff/esp/Esp.h:int id = 0;
    bot_stuff/esp/Esp.h:boolean writeString (String buffer, int len);
    bot_stuff/esp/Error.h:void errorLED(errorType errorCode, int LEDPin);
    bot_stuff/esp/esp.ino:boolean writeString (String buffer, int len) {
    bot_stuff/esp/esp.ino:        int state = HIGH;
    bot_stuff/esp/esp.ino:        int toggle = HIGH ^ LOW;
    bot_stuff/esp/esp.ino:        int state = HIGH;
    bot_stuff/esp/esp.ino:        int toggle = HIGH ^ LOW;
    bot_stuff/esp/esp.ino:        int state = HIGH;
    bot_stuff/esp/esp.ino:        int toggle = HIGH ^ LOW;
    bot_stuff/Libraries/Error.cpp:void errorLED(errorType error, int LEDPin) {
    bot_stuff/Libraries/Error.cpp:        int state = HIGH;
    bot_stuff/Libraries/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/Libraries/Error.cpp:        int state = HIGH;
    bot_stuff/Libraries/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/Libraries/Error.cpp:        int state = HIGH;
    bot_stuff/Libraries/Error.cpp:        int toggle = HIGH ^ LOW;
    bot_stuff/Libraries/Sensor.cpp:    int i;
    bot_stuff/Libraries/Constants.h:const int AL = 2;
    bot_stuff/Libraries/Constants.h:const int BL = 3;
    bot_stuff/Libraries/Constants.h:const int AR = 4;
    bot_stuff/Libraries/Constants.h:const int BR = 5;
    bot_stuff/Libraries/Constants.h:const int encL = 6;
    bot_stuff/Libraries/Constants.h:const int encR = 7;
    bot_stuff/Libraries/Constants.h:const int numSlits = 30;
    bot_stuff/Libraries/Constants.h:const int numSens = 8; // number of sensors used
    bot_stuff/Libraries/Constants.h:const int clockPin = 12;
    bot_stuff/Libraries/Constants.h:const int latchPin = 11;
    bot_stuff/Libraries/Constants.h:const int dataPin = 10;
    bot_stuff/Libraries/Constants.h:const int echoPin = 8;
    bot_stuff/Libraries/Constants.h:const int servoPin = 9;
    bot_stuff/Libraries/Error.h:void errorLED(errorType errorCode, int LEDPin);
    Binary file server_stuff/mapgen/build/hough.o matches
    server_stuff/mapgen/include/hough.h:const int numDim = 2;
    server_stuff/mapgen/include/hough.h:    int isMaxima(tableIndices idx);
    server_stuff/mapgen/include/hough.h:table::index getIndex(const table& m, const float* requestedElement, const unsigned short int direction);
    server_stuff/mapgen/include/hough.cpp:int houghSpace::isMaxima(tableIndices idx)
    server_stuff/mapgen/include/hough.cpp:    int indexDiff[3] = {-1, 0, 1};
    server_stuff/mapgen/include/hough.cpp:        int safe = 1;
    server_stuff/mapgen/include/hough.cpp:table::index getIndex(const table& m, const float* requestedElement, const unsigned short int direction)
    server_stuff/mapgen/include/hough.cpp:    int offset = requestedElement - m.origin();
    server_stuff/mapgen/include/hough.cpp:    for (unsigned int dir = 0; dir < numDim; dir++)
    server_stuff/network/payload.h: int bot_id;
    server_stuff/network/server.c:int main(int argc, char *argv[])
    server_stuff/network/server.c:    int listenfd = 0, connfd = 0;
    server_stuff/network/server.c:    int readbytes = 0, correctread;
    
  2. parthmittal commented on Mar 25, 2016

    @parthmittal
    MemberAuthor

    also long long -> int_64t, and possibly adding the correct suffixes to literals everywhere

  3. RadhikaG commented on Mar 25, 2016

    @RadhikaG
    Member

    In the hardware code, all pin constants, 'byte' variables, and variables taking on only 1 or 0 should be changed from 'int' to 'uint8_t' due to space constraints on the Arduino.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions