Use sizeof(field) instead of sizeof(type) and other fixes. (#47)

* Use sizeof(field) instead of sizeof(type) and other fixes.

* Fix formatting.

* Bug fix.

* Zero-initialize structs. There are many more instances of these that I haven't changed yet.

* Bug fix.

* Revert from atexit to signaling to fix valgrind tests.

* Address Philipp's comments.
This commit is contained in:
Robert Nishihara
2016-11-19 12:19:49 -08:00
committed by Philipp Moritz
parent d77b685a90
commit c8c3983195
16 changed files with 106 additions and 100 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ task_id compute_task_id(task_spec *spec) {
/* Create a task ID out of the hash. This will truncate the hash. */
task_id task_id;
CHECK(sizeof(task_id) <= SHA256_BLOCK_SIZE);
memcpy(&task_id.id, buff, sizeof(task_id));
memcpy(&task_id.id, buff, sizeof(task_id.id));
return task_id;
}