Skip to content
Snippets Groups Projects
Commit 5b287d1a authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

Oops. Only write one width.

parent c9973e18
No related merge requests found
...@@ -40,10 +40,10 @@ static inline wb_data_t eb_to_cpu(unsigned char* x) ...@@ -40,10 +40,10 @@ static inline wb_data_t eb_to_cpu(unsigned char* x)
static inline void eb_from_cpu(unsigned char* x, wb_data_t dat) static inline void eb_from_cpu(unsigned char* x, wb_data_t dat)
{ {
switch (sizeof(wb_data_t)) { switch (sizeof(wb_data_t)) {
case 8: *(wb_data_t*)x = cpu_to_be64(dat); case 8: *(wb_data_t*)x = cpu_to_be64(dat); break;
case 4: *(wb_data_t*)x = cpu_to_be32(dat); case 4: *(wb_data_t*)x = cpu_to_be32(dat); break;
case 2: *(wb_data_t*)x = cpu_to_be16(dat); case 2: *(wb_data_t*)x = cpu_to_be16(dat); break;
case 1: *(wb_data_t*)x = dat; case 1: *(wb_data_t*)x = dat; break;
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment