gemhome/rmagick — pull request #111 by u338steven (2014-08-23 07:22:15+00:00)
Title: Fixed: crash trying to 'test_formats' on Windows.(Magick.rb)

### Error message
Segmentation fault
```
C:\ruby\Ruby200-x64\lib\ruby\gems\2.0.0\gems\rmagick-2.13.3\test>ruby test_all_basic.rb
C:/ruby/Ruby200-x64/lib/ruby/site_ruby/2.0.0/RMagick.rb:1836: warning: assigned but unused variable - current
2.0.0
String
C:/ruby/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagick-2.13.3/test/Magick.rb:308: warning: assigned but unused variable -
img
Loaded suite test_all_basic
Started
...C:/ruby/Ruby200-x64/lib/ruby/site_ruby/2.0.0/RMagick.rb:20: [BUG] Segmentation fault
ruby 2.0.0p451 (2014-02-24) [x64-mingw32]

-- Control frame information -----------------------------------------------
c:0027 p:---- s:0121 e:000120 CFUNC :init_formats
c:0026 p:0021 s:0118 e:000117 METHOD C:/ruby/Ruby200-x64/lib/ruby/site_ruby/2.0.0/RMagick.rb:20
c:0025 p:0013 s:0114 e:000113 BLOCK C:/ruby/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagick-2.13.3/test/Magick.rb:93

```

### Cause
type mismatch
on windows x64
- sizeof(unsigned long) = 4
- sizeof(size_t) = 8

### Type

> **GetMagickInfoList(const char *,size_t *,ExceptionInfo *);

ImageMagick/magick.h at master · trevor/ImageMagick

---

Fixed similar

> **GetColorInfoList(const char *,size_t *,ExceptionInfo *);

ImageMagick/color.h at master · trevor/ImageMagick

---

> **GetTypeInfoList(const char *,size_t *,ExceptionInfo *);

ImageMagick/type.h at master · trevor/ImageMagick

---

> *SampleImage(const Image *,const size_t,const size_t,ExceptionInfo *),

ImageMagick/resize.h at master · trevor/ImageMagick

---

> GetImageChannelExtrema(const Image *,const ChannelType,size_t *,size_t *,
> ExceptionInfo *),

ImageMagick/statistic.h at master · trevor/ImageMagick

---

> *GetImageHistogram(const Image *,size_t *,ExceptionInfo *);

ImageMagick/histogram.h at master · trevor/ImageMagick

---

> IsImageSimilar(const Image *,const Image *,ssize_t *x,ssize_t *y,
> ExceptionInfo *),

ImageMagick/color.h at master · trevor/ImageMagick