Skip to content

Commit 8bcef18

Browse files
authored
Merge pull request #3721 from BsAtHome/fix_warnings-clang
Fix warnings detected by clang
2 parents 11cf4db + 38ef6f3 commit 8bcef18

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/emc/kinematics/switchkins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static int gui_forward_kins(const double *joints)
100100
// genhexkins and identity kinematic types
101101
// (similar needs for many parallel kinemtic machines)
102102
int res;
103-
KINEMATICS_FORWARD_FLAGS fflags;
103+
KINEMATICS_FORWARD_FLAGS fflags = 0;
104104
KINEMATICS_INVERSE_FLAGS iflags;
105105
switch (kp.gui_kinstype) {
106106
case 0: res = kfwd0(joints, &lastpose[0], &fflags, &iflags);break;

src/emc/tp/sp_scurve.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ num initial calculation value
5353
*/
5454
double solute( double a, double b, double c, double d, double num){
5555
double x ,x0 ,f ,f1;
56-
int cnt = 0;
56+
//int cnt = 0;
5757
x = num;
5858
do{
5959
x0 = x;
6060
f = (( a*x0 + b )*x0 + c )*x0 + d;
6161
f1 = ( 3*a*x0 + 2*b )*x0 + c;
6262
x = x0 - f / f1;
63-
cnt++;
63+
//cnt++;
6464
} while ( fabs( x - x0 ) > 1e-6 );
6565

6666
//printf( "the value is %.14f \r\n", x );
@@ -1350,4 +1350,4 @@ double calcSCurveSpeedWithT(double amax, double jerk, double T) {
13501350

13511351
// Use fma to optimize multiply-add operations, improving numerical stability
13521352
return fma(jerk * T1, T1 + T2, 0.0);
1353-
}
1353+
}

src/hal/drivers/mesa-hostmot2/hm2_modbus.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static const char *error_codes[] = {
108108
#define MBT_X_MASK 0x0f
109109
#define MBT_T_MASK 0xf0
110110

111-
static inline bool mtypeiscompound(unsigned mtype) { return mtype >= MBT_ABCD && mtype <= MBT_HGFEDCBA; }
111+
// static inline bool mtypeiscompound(unsigned mtype) { return mtype >= MBT_ABCD && mtype <= MBT_HGFEDCBA; }
112112
static inline unsigned mtypeformat(unsigned mtype) { return mtype & MBT_X_MASK; }
113113
static inline unsigned mtypetype(unsigned mtype) { return mtype & MBT_T_MASK; }
114114
static inline bool mtypeisvalid(unsigned mtype) {
@@ -818,8 +818,9 @@ static void process(void *arg, long period)
818818
// Are we handling init commands?
819819
if(handling_inits(inst)) {
820820
// Yes, prepare and send
821+
hm2_modbus_cmd_t *cc;
821822
retry_next_init:
822-
hm2_modbus_cmd_t *cc = current_cmd(inst);
823+
cc = current_cmd(inst);
823824
if(0 == cc->cmd.func) {
824825
// Special meta command
825826
if(0 == cc->cmd.imetacmd) { // This is a delay command
@@ -2162,8 +2163,9 @@ static ssize_t read_mbccb(const hm2_modbus_inst_t *inst, const char *fname, hm2_
21622163
}
21632164

21642165
// Read the entire file
2166+
ssize_t err;
21652167
retry_read:
2166-
ssize_t err = read(fd, *pmbccb, sb.st_size);
2168+
err = read(fd, *pmbccb, sb.st_size);
21672169
if(err < 0) {
21682170
ssize_t rv = -errno;
21692171
if(errno == EINTR)

0 commit comments

Comments
 (0)