Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 2017 14:30:23 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r457462 - in head/x11/hsetroot: . files
Message-ID:  <201712281430.vBSEUNe7047997@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Thu Dec 28 14:30:23 2017
New Revision: 457462
URL: https://svnweb.freebsd.org/changeset/ports/457462

Log:
  Unbreak the build (at least) on powerpc, powerpc64, sparc64, by moving the
  `for' loop initial declaration variable outside; this was upsetting C99:
  
    hsetroot.c: In function 'load_image':
    hsetroot.c:196: error: 'for' loop initial declaration used outside C99 mode
  
  Tested on:	powerpc, sparc64

Modified:
  head/x11/hsetroot/Makefile
  head/x11/hsetroot/files/patch-hsetroot.c

Modified: head/x11/hsetroot/Makefile
==============================================================================
--- head/x11/hsetroot/Makefile	Thu Dec 28 14:28:38 2017	(r457461)
+++ head/x11/hsetroot/Makefile	Thu Dec 28 14:30:23 2017	(r457462)
@@ -13,8 +13,6 @@ LICENSE=	GPLv2
 
 LIB_DEPENDS=	libImlib2.so:graphics/imlib2
 
-BROKEN_powerpc64=	fails to compile: hsetroot.c: error: 'for' loop initial declaration used outside C99 mode
-
 USE_GITHUB=	yes
 GH_ACCOUNT=	himdel
 GH_TAGNAME=	47d887b

Modified: head/x11/hsetroot/files/patch-hsetroot.c
==============================================================================
--- head/x11/hsetroot/files/patch-hsetroot.c	Thu Dec 28 14:28:38 2017	(r457461)
+++ head/x11/hsetroot/files/patch-hsetroot.c	Thu Dec 28 14:30:23 2017	(r457462)
@@ -17,6 +17,24 @@
      " -tile <image>              Render an image tiled\n"
      " -full <image>              Render an image maximum aspect\n"
      " -extend <image>            Render an image max aspect and fill borders\n"
+@@ -165,7 +166,7 @@ parse_color(char *arg, PColor c, int a)
+ int
+ load_image(ImageMode mode, const char *arg, int alpha, Imlib_Image rootimg, OutputInfo *outputs, int noutputs)
+ {
+-  int imgW, imgH, o;
++  int i, imgW, imgH, o;
+   Imlib_Image buffer = imlib_load_image(arg);
+ 
+   if (!buffer)
+@@ -193,7 +194,7 @@ load_image(ImageMode mode, const char *arg, int alpha,
+ 
+   imlib_context_set_image(rootimg);
+ 
+-  for (int i = 0; i < noutputs; i++) {
++  for (i = 0; i < noutputs; i++) {
+     OutputInfo o = outputs[i];
+     printf("output %d: size(%d, %d) pos(%d, %d)\n", i, o.w, o.h, o.x, o.y);
+ 
 @@ -229,6 +230,20 @@ load_image(ImageMode mode, const char *arg, int alpha,
            }
          }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712281430.vBSEUNe7047997>