bugGNU Octave - Bugs: bug #47912, __gnuplot_drawnow__.m arguments do...

 
 

bug #47912: __gnuplot_drawnow__.m arguments do not match the calling C arguments

Submitter:  Dan Sebald <sebald>
Submitted:  Fri 13 May 2016 08:42:38 AM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 14 May 2016 04:03:30 AM UTC, comment #3: 

I had to make one more change in graphics.in.h to eliminate an instance of mono.  Other than that, I pushed your cset here (http://hg.savannah.gnu.org/hgweb/octave/rev/21fdab18f857). 

Thanks for the fix.  Closing report as done.

Rik <rik5>
Group administrator
Sat 14 May 2016 12:11:00 AM UTC, comment #2: 

I'm attaching a patch file changeset to remove all references to 'mono' throughout the code.  The figure/plot and print commands seem to work for all toolkits here.  Let me know if they work for you.


(file #37149)

Dan Sebald <sebald>
Fri 13 May 2016 11:03:37 AM UTC, comment #1: 

print.m has been modified to handle color/mono. This was already being done for the OpenGL toolkits. To reduce the complexity of the code, the same approach as applied to Gnuplot.

http://hg.savannah.gnu.org/hgweb/octave/rev/5b9618f4f841

The correct fix is to remove the "mono" argument from calls to gnuplot_drawnow.

If someone doesn't get to it first, I'll take a look over the weekend.

Ben Abbott <bpabbott>
Group Member
Fri 13 May 2016 08:42:38 AM UTC, original submission:  

The debugging method of

  drawnow (TERM, FILE, MONO, DEBUG_FILE)

no longer works, giving the following errors:


>> sombrero
>> drawnow ("x11", "/dev/null", false, "sombrero_copper.gp");
error: wrong type argument 'bool'
error: fopen: filename must be a string


The reason for the error is that the _gnuplot_drawnow_.m routine has one fewer input arguments than the calling C code.  Here is how I've fixed the problem and I added a comment near the calling code to illustrate the number of input arguments.


diff --git a/libinterp/dldfcn/__init_gnuplot__.cc b/libinterp/dldfcn/__init_gnuplot__.cc
--- a/libinterp/dldfcn/__init_gnuplot__.cc
+++ b/libinterp/dldfcn/__init_gnuplot__.cc
@@ -110,6 +110,7 @@ public:
   {
     octave_value_list args;
     if (! debug_file.empty ())
+// Number of arguments is one more than __gnuplot_drawnow__()
       args(4) = debug_file;
     args(3) = mono;
     args(2) = file;
diff --git a/scripts/plot/util/__gnuplot_drawnow__.m b/scripts/plot/util/__gnuplot_drawnow__.m
--- a/scripts/plot/util/__gnuplot_drawnow__.m
+++ b/scripts/plot/util/__gnuplot_drawnow__.m
@@ -23,7 +23,7 @@

 ## Author: jwe

-function __gnuplot_drawnow__ (h, term, file, debug_file)
+function __gnuplot_drawnow__ (h, term, file, mono, debug_file)

   if (nargin < 1 || nargin > 5 || nargin == 2)
     print_usage ();



There no longer appears to be use of 'mono' in the _gnuplot_drawnow_ routine, so perhaps the intension was to remove the 'mono' and reduce the number of options sent into the routine.  That would mean that the print_figure() mono variable is unused.

Dan Sebald <sebald>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by sebald (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-14 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2016-05-14 sebald Attached File- Added octave-drawnow-djs2016may13.patch, #37149

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code