diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-12 10:28:23 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-12 10:28:23 +0100 |
commit | 9a51195b1ce73005e87c00448c908286fb5c07d7 (patch) | |
tree | dcb5318895ac3f15a0d4a7f8bca9acdf2ea8d699 /cli.c | |
parent | a52db447b5d63de3304f4351a4a953ab8f4b13e5 (diff) | |
download | pcitool-9a51195b1ce73005e87c00448c908286fb5c07d7.tar.gz pcitool-9a51195b1ce73005e87c00448c908286fb5c07d7.tar.bz2 pcitool-9a51195b1ce73005e87c00448c908286fb5c07d7.tar.xz pcitool-9a51195b1ce73005e87c00448c908286fb5c07d7.zip |
Declare volatile differently
Diffstat (limited to 'cli.c')
-rw-r--r-- | cli.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -1084,11 +1084,11 @@ typedef struct { size_t trigger_time; size_t max_triggers; - int event_pending; /**< Used to detect that we have read previously triggered event */ - int trigger_thread_started; /**< Indicates that trigger thread is ready and we can't procced to start event recording */ - int started; /**< Indicates that recording is started */ + int event_pending; /**< Used to detect that we have read previously triggered event */ + volatile int trigger_thread_started; /**< Indicates that trigger thread is ready and we can't procced to start event recording */ + volatile int started; /**< Indicates that recording is started */ - int run_flag; + volatile int run_flag; struct timeval first_frame; struct timeval last_frame; @@ -1178,7 +1178,7 @@ int raw_data(pcilib_event_id_t event_id, pcilib_event_info_t *info, pcilib_event void *Trigger(void *user) { struct timeval start; - volatile GRABContext *ctx = (GRABContext*)user; + GRABContext *ctx = (GRABContext*)user; size_t trigger_time = ctx->trigger_time; size_t max_triggers = ctx->max_triggers; @@ -1237,7 +1237,7 @@ void GrabStats(GRABContext *ctx, struct timeval *end_time) { void *Monitor(void *user) { struct timeval deadline; - volatile GRABContext *ctx = (GRABContext*)user; + GRABContext *ctx = (GRABContext*)user; pcilib_timeout_t timeout = ctx->timeout; if (timeout == PCILIB_TIMEOUT_INFINITE) timeout = 0; @@ -1245,18 +1245,17 @@ void *Monitor(void *user) { // while (!ctx->started); if (timeout) { - memcpy(&deadline, &ctx->last_frame, sizeof(struct timeval)); + memcpy(&deadline, (struct timeval*)&ctx->last_frame, sizeof(struct timeval)); pcilib_add_timeout(&deadline, timeout); } while (ctx->run_flag) { if (timeout) { if (pcilib_calc_time_to_deadline(&deadline) == 0) { - memcpy(&deadline, &ctx->last_frame, sizeof(struct timeval)); + memcpy(&deadline, (struct timeval*)&ctx->last_frame, sizeof(struct timeval)); pcilib_add_timeout(&deadline, timeout); if (pcilib_calc_time_to_deadline(&deadline) == 0) { - puts("stop"); pcilib_stop(ctx->handle, PCILIB_EVENT_FLAG_STOP_ONLY); break; } |