<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I received this response from Liam Healy over in cffi-devel and am
    posting his response. I have also done as Edi suggested and
    submitted an issue on cl-gd at github. <br>
    <br>
    --Jeff<br>
    <div class="moz-forward-container"><br>
      <br>
      -------- Original Message --------
      <table class="moz-email-headers-table" border="0" cellpadding="0"
        cellspacing="0">
        <tbody>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject:
            </th>
            <td>Re: [cffi-devel] cffi changes are generating deprecation
              warning in cl-gd now</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
            <td>Mon, 27 Jan 2014 21:07:11 -0700</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
            <td>Liam Healy <a class="moz-txt-link-rfc2396E" href="mailto:lnp@healy.washington.dc.us"><lnp@healy.washington.dc.us></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
            <td>Jeff Cunningham <a class="moz-txt-link-rfc2396E" href="mailto:jeffrey@jkcunningham.com"><jeffrey@jkcunningham.com></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap="nowrap" valign="BASELINE">CC: </th>
            <td>CFFI <a class="moz-txt-link-rfc2396E" href="mailto:cffi-devel@common-lisp.net"><cffi-devel@common-lisp.net></a>,
              <a class="moz-txt-link-abbreviated" href="mailto:cl-gd-devel@common-lisp.net">cl-gd-devel@common-lisp.net</a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <div dir="ltr">
        <div>
          <div>
            <div>Hi Jeff,<br>
              <br>
            </div>
            It's harmless, it's just telling you that the syntax that
            cl-gd uses for structure arguments will eventually (in a
            future version of CFFI) not work. The messages describes the
            problem. The structure is specified as cl-gd::gd-image  in a
            function argument or return value. In the old versions of
            CFFI, that was interpreted as a pointer to that structure,
            because there was no other possibility. Now structures can
            also be passed/returned by value using cffi-libffi, so you
            have to say explicitly as the error message indicates. They
            might also need to change the use of #'mem-aref (which
            before returned a pointer to the structure but now returns
            the structure itself) into a #'mem-aptr.<br>
            <br>
          </div>
          I'm not subscribed to the cl-gd-devel list, so you should
          forward this response there.<br>
          <br>
        </div>
        Liam<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, Jan 27, 2014 at 4:42 PM, Jeff
          Cunningham <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:jeffrey@jkcunningham.com" target="_blank">jeffrey@jkcunningham.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi;<br>
            <br>
            A short while ago I started noticing this error message
            showing up<br>
            <br>
            ;; STYLE-WARNING:<br>
            ;;    bare references to struct types are deprecated. Please
            use (:POINTER (:STRUCT CL-GD::GD-IMAGE))<br>
            ;;    or (:STRUCT CL-GD::GD-IMAGE) instead.<br>
            <br>
            It took me awhile to extract a simple demo case, but I've
            narrowed it down to the WITH-THICKNESS macro call I believe.<br>
            I'm not sure which list would be best for this question, so
            I cross-posted it.<br>
            <br>
            Here's a test case.<br>
            <br>
            (ql:quickload "cl-gd")<br>
            (use-package :cl-gd)<br>
            <br>
            (let* ((x1 -86)<br>
                   (x2 529)<br>
                   (y1 -0.13)<br>
                   (y2 1.16)<br>
                   (xv '(0.0 1.0 2.0 3.0 4.0))<br>
                   (yv '(0.99 0.12 0.66 0.24 0.075)))<br>
              (with-image* (500 250)<br>
                (allocate-color 255 255 255)<br>
                (let ((c (allocate-color 0 0 255)))<br>
                  (with-transformation (:x1 x1 :x2 x2 :y1 y1 :y2 y2)<br>
                    (with-thickness (1)<br>
                      (mapl #'(lambda (x y)<br>
                                (when (and (cdr x) (cdr y))<br>
                                  (draw-line (car x) (car y) (cadr x)
            (cadr y) :color c))) xv yv))<br>
                    (write-image-to-file "test.png" :if-exists
            :supersede)))))<br>
            <br>
            If you take out the with-thickness macro call the message
            disappears.<br>
            <br>
            I played around with that macro but don't really understand
            enough about the intricacies of cffi to fix it.<br>
            Does anyone have any ideas? Here's the macro in question:<br>
            <br>
            (defmacro with-thickness ((thickness &key (image
            '*default-image*)) &body body)<br>
              "Executes BODY with the current line width of IMAGE set to<br>
            THICKNESS. The image's previous line width is guaranteed to
            be<br>
            restored before the macro exits. Note that the line width is
            measured<br>
            in pixels and is not affected by WITH-TRANSFORMATION."<br>
              (cl-gd::with-unique-names (old-thickness)<br>
                ;; we rebind everything so we have left-to-right
            evaluation<br>
                (cl-gd::with-rebinding (thickness image)<br>
                  `(let ((,old-thickness (thickness ,image)))<br>
                     (unwind-protect<br>
                         (progn<br>
                           (setf (thickness ,image) ,thickness))<br>
                       ,@body)<br>
                     (setf (thickness ,image) ,old-thickness)))))<br>
            <br>
            <br>
            Much obliged.<span class="HOEnZb"><font color="#888888"><br>
                <br>
                --Jeff Cunningham<br>
                <br>
                <br>
              </font></span></blockquote>
        </div>
        <br>
      </div>
      <br>
    </div>
    <br>
  </body>
</html>