Skip to content

Commit

Permalink
Use <stdint.h> for uint* types (fix build on musl) (#1618)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesamesam committed Feb 6, 2022
1 parent 505ba93 commit 7df8ca6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion base64.c
Expand Up @@ -45,7 +45,7 @@
* Swap bytes in 16-bit value.
*/
//#define bswap_16(x) __builtin_bswap16 (x);
#define bswap_16(x) ((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
#define bswap_16(x) ((uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))

#include <arpa/inet.h>
#define IS_BIG_ENDIAN (1 == htons(1))
Expand Down
4 changes: 2 additions & 2 deletions drivers/focuser/focuslynxbase.cpp
Expand Up @@ -2821,7 +2821,7 @@ bool FocusLynxBase::SyncFocuser(uint32_t ticks)
/************************************************************************************
*
* ***********************************************************************************/
//bool FocusLynxBase::setMaxTravel(u_int16_t travel)
//bool FocusLynxBase::setMaxTravel(uint16_t travel)
bool FocusLynxBase::SetFocuserMaxPosition(uint32_t ticks)
{
char cmd[LYNX_MAX] = {0};
Expand Down Expand Up @@ -2886,7 +2886,7 @@ bool FocusLynxBase::SetFocuserMaxPosition(uint32_t ticks)
/************************************************************************************
*
* ***********************************************************************************/
bool FocusLynxBase::setStepSize(u_int16_t stepsize)
bool FocusLynxBase::setStepSize(uint16_t stepsize)
{
char cmd[LYNX_MAX] = {0};
int errcode = 0;
Expand Down
3 changes: 2 additions & 1 deletion drivers/focuser/focuslynxbase.h
Expand Up @@ -28,6 +28,7 @@
#include "connectionplugins/connectiontcp.h"

#include <map>
#include <stdint.h>
#include <termios.h>
#include <unistd.h>
#include <memory>
Expand Down Expand Up @@ -154,7 +155,7 @@ class FocusLynxBase : public INDI::Focuser
// Set functions

// Position
bool setStepSize(u_int16_t stepsize);
bool setStepSize(uint16_t stepsize);

// Temperature
bool setTemperatureCompensation(bool enable);
Expand Down
3 changes: 2 additions & 1 deletion drivers/rotator/gemini.h
Expand Up @@ -23,6 +23,7 @@
#include "indifocuser.h"
#include "indirotatorinterface.h"

#include <stdint.h>
#include <map>

class Gemini : public INDI::Focuser, public INDI::RotatorInterface
Expand Down Expand Up @@ -132,7 +133,7 @@ class Gemini : public INDI::Focuser, public INDI::RotatorInterface
// Set functions

// Position
bool setFocusPosition(u_int16_t position);
bool setFocusPosition(uint16_t position);

// Temperature
bool setTemperatureCompensation(bool enable);
Expand Down
7 changes: 2 additions & 5 deletions drivers/telescope/celestrondriver.h
Expand Up @@ -28,10 +28,7 @@
#include <string>
#include "indicom.h"

#ifdef __FreeBSD__
#include <stdint.h>
typedef uint8_t u_int8_t;
#endif

//#include <thread>
//#include <condition_variable>
Expand Down Expand Up @@ -312,8 +309,8 @@ class CelestronDriver

// get and set guide rate
// 0 to 255 corresponding to 0 to 100% sidereal
bool get_guide_rate(CELESTRON_AXIS axis, u_int8_t * rate);
bool set_guide_rate(CELESTRON_AXIS axis, u_int8_t rate);
bool get_guide_rate(CELESTRON_AXIS axis, uint8_t * rate);
bool set_guide_rate(CELESTRON_AXIS axis, uint8_t rate);

// Pointing state, pier side, returns 'E' or 'W'
bool get_pier_side(char * sop);
Expand Down

0 comments on commit 7df8ca6

Please sign in to comment.