about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--editor/pamrecolor.c9
-rw-r--r--editor/specialty/pampaintspill.c5
2 files changed, 6 insertions, 8 deletions
diff --git a/editor/pamrecolor.c b/editor/pamrecolor.c
index 51fc30c4..d7bcaa0f 100644
--- a/editor/pamrecolor.c
+++ b/editor/pamrecolor.c
@@ -24,7 +24,6 @@
  * ----------------------------------------------------------------------
  */
 
-#define _XOPEN_SOURCE 600  /* Make sure random(), srandom() are in <stdlib.h>*/
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -181,9 +180,9 @@ randomlyColorRow(struct pam *   const pamP,
     unsigned int col;
 
     for (col = 0; col < pamP->width; ++col) {
-        rowData[col][PAM_RED_PLANE] = random() / (float)RAND_MAX;
-        rowData[col][PAM_GRN_PLANE] = random() / (float)RAND_MAX;
-        rowData[col][PAM_BLU_PLANE] = random() / (float)RAND_MAX;
+        rowData[col][PAM_RED_PLANE] = rand() / (float)RAND_MAX;
+        rowData[col][PAM_GRN_PLANE] = rand() / (float)RAND_MAX;
+        rowData[col][PAM_BLU_PLANE] = rand() / (float)RAND_MAX;
     }
 }
 
@@ -457,7 +456,7 @@ main(int argc, const char *argv[]) {
 
     pm_proginit(&argc, argv);
 
-    srandom(pm_randseed());
+    srand(pm_randseed());
 
     parseCommandLine(argc, argv, &cmdline);
 
diff --git a/editor/specialty/pampaintspill.c b/editor/specialty/pampaintspill.c
index f9fe53c4..745c9b68 100644
--- a/editor/specialty/pampaintspill.c
+++ b/editor/specialty/pampaintspill.c
@@ -37,7 +37,6 @@
   10.04.14
 */
 
-#define _XOPEN_SOURCE 600  /* Make sure random(), srandom() are in <stdlib.h>*/
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -254,11 +253,11 @@ locatePaintSources(struct pam *            const pamP,
     if (downsample > 0 && downsample < paintSources.size) {
         unsigned int i;
 
-        srandom(time(NULL));
+        srand(time(NULL));
 
         for (i = 0; i < downsample; ++i) {
             unsigned int const swapIdx =
-                i + random() % (paintSources.size - i);
+                i + rand() % (paintSources.size - i);
             struct coords const swapVal = paintSources.list[i];
 
             paintSources.list[i] = paintSources.list[swapIdx];