[gephex-devel] gephex--main--0.4--patch-1873

gephex at sonnenland.kexbox.org gephex at sonnenland.kexbox.org
Sat Apr 2 12:29:14 CEST 2005


Archive: gephex at gephex.org--2004
New revision: gephex--main--0.4--patch-1873

--
Revision: gephex--main--0.4--patch-1873
Archive: gephex at gephex.org--2004
Creator: The Gephex Source Archive <gephex at gephex.org>
Date: Sat Apr  2 12:26:03 CEST 2005
Standard-date: 2005-04-02 10:26:03 GMT
Modified-files: modules/src/noisemodule/noisemodule.cpp
New-patches: gephex at gephex.org--2004/gephex--main--0.4--patch-1873
    martin at gephex.org--2004/gephex--martin--0.4--patch-68
Summary: [MERGE-REQUEST] fix for endianess bug in noisemodule (#116)
Keywords: 

Patches applied:

 * martin at gephex.org--2004/gephex--martin--0.4--patch-68
   fix for endianess bug in noisemodule (#116) 

* added files

    {arch}/gephex/gephex--main/gephex--main--0.4/gephex at gephex.org--2004/patch-log/patch-1873
    {arch}/gephex/gephex--martin/gephex--martin--0.4/martin at gephex.org--2004/patch-log/patch-68

* modified files

--- orig/modules/src/noisemodule/noisemodule.cpp
+++ mod/modules/src/noisemodule/noisemodule.cpp
@@ -46,16 +46,23 @@
 
 uint32_t mono_noise()
 {
-  uint8_t rd = rnd_lcg1() >> 24;
-  return rd | rd << 8 | rd << 16;
+  uint8_t color[4];
+  uint8_t tmp = rnd_lcg1() >> 24;
+  color[0] = tmp;
+  color[1] = tmp;
+  color[2] = tmp;
+  color[3] = 0;
+  return *reinterpret_cast<uint32_t*>(&color);
 }
 
 uint32_t chroma_noise()
 {
-  uint8_t rd_1 = rnd_lcg1() >> 24;
-  uint8_t rd_2 = rnd_lcg1() >> 24;
-  uint8_t rd_3 = rnd_lcg1() >> 24;
-  return rd_1 | rd_2 << 8 | rd_3 << 16;
+  uint8_t color[4];
+  color[0] = rnd_lcg1() >> 24;
+  color[1] = rnd_lcg1() >> 24;
+  color[2] = rnd_lcg1() >> 24;
+  color[3] = 0;
+  return *reinterpret_cast<uint32_t*>(&color);
 }
 
 void update(void* instance)



More information about the gephex-devel mailing list