[ARDrone] Use ++var instead of var++ if possible

This commit is contained in:
Matteo Cypriani 2011-08-18 11:50:55 +02:00
parent b2b24ed551
commit 7ce171b2ef
1 changed files with 11 additions and 11 deletions

View File

@ -229,7 +229,7 @@ int main(int argc, char *argv[])
share_relatif_cons.y) ;
//printf("[DEBUG] Vitesse %f Angle %f state %d\n",speed_pitch, angle,state_flying);
}
i_consigne++;
++i_consigne ;
}
fclose(log);
cmd_drone_landing();
@ -307,7 +307,7 @@ void traficGPS(int gps) {
length=y-1;
break;
}
y++;
++y ;
}
//printf("\nTaille finale : %d\n", length);
@ -326,10 +326,10 @@ void traficGPS(int gps) {
y - offset_line) ;
data[ct_string][y-offset_line]=0;
}
ct_string++;
++ct_string ;
offset_line=y+1;
}
y++;
++y ;
}
if(!(ct_string==0 || offset_line==0))
@ -469,7 +469,7 @@ void* thread_control(void* NULL_value)
array_cons[num_point].lat = share_gps_cons.lat;
array_cons[num_point].lon = share_gps_cons.lon;
array_cons[num_point].alt = share_gps_cons.alt;
num_point++;
++num_point ;
printf("[Consigne %d point défini]\n", num_point);
}
else if (strcmp(cmd, "SendSetpoint")==0) {
@ -546,7 +546,7 @@ void parse_main_options(int argc, char **argv)
// Take the optind value:
options.listening_port =
strtoul(argv[optind], NULL, 0) ;
optind++ ;
++optind ;
}
}
break ;
@ -854,7 +854,7 @@ void string2data(char* string_data)
break ;
}
sscanf(ptr, "%ld", &timestamp.tv_nsec) ;
onetime++;
++onetime ;
}
result results[10];
@ -959,11 +959,11 @@ void string2data(char* string_data)
results[count_algo].err = atof(ptr) ;
count_algo++;
++count_algo ;
}
else
count_algo++;
++count_algo ;
}
for (count_print = 0 ; count_print < count_algo ; ++count_print)
@ -1201,7 +1201,7 @@ int cmd_drone_move(float speed_pitch, int angle)
sprintf(sendline, "AT*PCMD=%d,1,0,%d,0,%d\r",
i, *floatint_speed_pitch, *floatint_speed_yaw) ;
//printf("%s\n", sendline);
i++;
++i ;
sendto(sockcmdfd,sendline,strlen(sendline),0,
(struct sockaddr *)&servcmd,sizeof(servcmd));
//printf("[ATPCMD] pitch : %f yaw : %f\n", speed_pitch, speed_yaw);
@ -1290,7 +1290,7 @@ void* drone_socket_watchdog(void* NULL_value)
strncat(sendline, LANDING, LENSTR);
strncat(sendline, "\r", LENSTR);
}
i++;
++i ;
if(i>=101)
{
strncat(sendline, "AT*COMWDG=", LENSTR);