Package is 1.1.2, octave 3.0.1:
octave:2> pkg install audio-1.1.2.tar.gz
aurecord.cc: In function ‘int capture(int, short int*, int)’:
aurecord.cc:335: warning: deprecated conversion from string constant to ‘char*’
aurecord.cc:345: warning: deprecated conversion from string constant to ‘char*’
aurecord.cc:365: warning: deprecated conversion from string constant to ‘char*’
aurecord.cc:381: warning: deprecated conversion from string constant to ‘char*’
aurecord.cc: In function ‘int capture(int, short int*, int)’:
aurecord.cc:335: warning: deprecated conversion from string constant to ‘char*’
aurecord.cc:345: warning: deprecated conversion from string constant to ‘char*’
aurecord.cc:365: warning: deprecated conversion from string constant to ‘char*’
aurecord.cc:381: warning: deprecated conversion from string constant to ‘char*’
After unloading/uninstalling, it leaves a "sound_play_utility" global
variable behind. Kids, didn't your parents tell you to clean the table
before you go? :)
That variable is set to
octave:7> sound_play_utility
sound_play_utility = ofsndplay -
I don't think I'll have much luck looking for "ofsndplay" on this
non-Mac system.
Generally, I think packages should not use global variables at all
themselves: if the user sets a variable, using it is okay, but don't
export them yourself:
So, if the user sets "sound_play_utility", that value should be used,
but it should not be a global variable the package exports itself.[1]
So, sound.m tries to set sound_play_utility again as global in line 89,
which fails; according to "doc global":
======================================================================
A global variable may only be initialized once in a `global'
statement. For example, after executing the following code
global gvar = 1
global gvar = 2
the value of the global variable `gvar' is 1, not 2.
======================================================================
Mercurial changeset attached for all of these[2]. If you want single
diffs for Subversion, just say so.
I think clip.m needs an overhaul (checking for do_fortran_indexing --
how long since that is in Octave?), but that's not part of the current
patch.
[1] My patch doesn't do that neither, but I don't see how to distinguish
between a broken value by the user and the current broken value coming
from the .oct/PKG_ADD file.
[2] Additionally available via
http://tw-math.de/~weber/audio.hg
Thomas
# HG changeset patch
# User Thomas Weber <[EMAIL PROTECTED]>
# Date 1219993647 -7200
# Node ID 3bdd917bd5eca20eb16fc67714070bcfb70db4bf
# Parent 9620b63dfcff35441e5bdb7f1ec6e0364fbd4f49
clear global variable sound_play_utility on pkg unloading
diff --git a/src/OFSndPlay.cc b/src/OFSndPlay.cc
--- a/src/OFSndPlay.cc
+++ b/src/OFSndPlay.cc
@@ -12,6 +12,7 @@
*/
// PKG_ADD: global sound_play_utility="ofsndplay -";
+// PKG_DEL: clear sound_play_utility;
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
# HG changeset patch
# User Thomas Weber <[EMAIL PROTECTED]>
# Date 1219994857 -7200
# Node ID ffc192363d65afec9da0b3761e6f38a2d5ebb90d
# Parent 3bdd917bd5eca20eb16fc67714070bcfb70db4bf
input to inform() is a const string
diff --git a/src/aurecord.cc b/src/aurecord.cc
--- a/src/aurecord.cc
+++ b/src/aurecord.cc
@@ -283,7 +283,7 @@
}
#endif
-void inform(char *str)
+void inform(const char *str)
{
if (str != NULL) {
#if 0
# HG changeset patch
# User Thomas Weber <[EMAIL PROTECTED]>
# Date 1219997152 -7200
# Node ID a9acc76109644006bd301882c218c6df5559874a
# Parent ffc192363d65afec9da0b3761e6f38a2d5ebb90d
correctly reset global sound_play_utility variable
diff --git a/inst/sound.m b/inst/sound.m
--- a/inst/sound.m
+++ b/inst/sound.m
@@ -85,7 +85,8 @@
endif
## If not running locally, then must use ssh to execute play command
- global sound_play_utility="play -t AU -";
+ global sound_play_utility;
+ sound_play_utility="play -t AU -";
if islocal
fid=popen(sound_play_utility, "w");
else
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev