Skip to content

Commit

Permalink
Merge pull request #1 from but0n/master
Browse files Browse the repository at this point in the history
refactor:(ReverseInt) A few enhancement
  • Loading branch information
tostq authored Mar 1, 2017
2 parents 4dff828 f496c58 commit 4699339
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions CNN/CNN/minst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 8,8 @@
//英特尔处理器和其他低端机用户必须翻转头字节。
int ReverseInt(int i)
{
unsigned char ch1, ch2, ch3, ch4;
ch1 = i & 255;
ch2 = (i >> 8) & 255;
ch3 = (i >> 16) & 255;
ch4 = (i >> 24) & 255;
return((int) ch1 << 24) ((int)ch2 << 16) ((int)ch3 << 8) ch4;
unsigned char *split = (unsigned char*)&i;
return ((int)split[0])<<24 | split[1]<<16 | split[2]<<8 | split[3];
}

ImgArr read_Img(const char* filename) // 读入图像
Expand Down

0 comments on commit 4699339

Please sign in to comment.