Author Topic: "deprecated conversion" Error with VoodooHDA on 10.6  (Read 2922 times)

0 Members and 1 Guest are viewing this topic.

girafx

  • Entrant
  • Posts: 3
"deprecated conversion" Error with VoodooHDA on 10.6
« on: January 23, 2010, 01:24:20 PM »
Error when building VoodooHDA 0.2.2 for 10.6
Code: [Select]
warning: deprecated conversion from string constant to 'char*'in line
Code: [Select]
void VoodooHDADevice::dumpNodes(FunctionGroup *funcGroup)
{
static char *ossname[] = SOUND_DEVICE_NAMES;
...


Any idea?

cosmo1t

  • VoodooLabs
  • Posts: 25
Re: "deprecated conversion" Error with VoodooHDA on 10.6
« Reply #1 on: January 23, 2010, 10:13:36 PM »
turn off warnings as errors.

Superhai

  • VoodooLabs
  • Posts: 102
Re: "deprecated conversion" Error with VoodooHDA on 10.6
« Reply #2 on: January 23, 2010, 10:24:49 PM »
Due to compatibility with C you could use char* as string constants, but it is not C++ proper and is now deprecated in gcc. So basically you should change char* to const char*.


girafx

  • Entrant
  • Posts: 3
Re: "deprecated conversion" Error with VoodooHDA on 10.6
« Reply #3 on: January 24, 2010, 02:28:31 AM »
Thanks! I used const before the wrong definitions and it worked for 60 from 64 errors.
Could you give your advice on this lines

error: assignment of read-only location
Code: [Select]
dumpAmp(widget->params.outAmpCap, "Output");

The second yet with deprication:
warning: deprecated conversion from string constant to 'char*'
Code: [Select]
control->widget->connsenable[control->index] = 0;

andyvand

  • VoodooLabs
  • Posts: 51
Re: "deprecated conversion" Error with VoodooHDA on 10.6
« Reply #4 on: February 21, 2010, 07:28:56 PM »
You can also use casts...
Check my version (above) to see how I fixed it up for SL
basically this means the following:
foo = "STRING";
becomes
foo = (char *)"STRING";
This will remove those warnings.
The SL version I made allready has all of these fixed...

Superhai

  • VoodooLabs
  • Posts: 102
Re: "deprecated conversion" Error with VoodooHDA on 10.6
« Reply #5 on: February 21, 2010, 08:49:52 PM »
You can also use casts...

Casting is bad programming because you override the type checking. Of course sometimes it is required, but I recommend to avoid it wherever possible.

girafx

  • Entrant
  • Posts: 3
Re: "deprecated conversion" Error with VoodooHDA on 10.6
« Reply #6 on: February 21, 2010, 09:00:23 PM »
Casts solved the problem!
Thnx
But  yet there is error in line
Code: [Select]
control->widget->connsenable[control->index] = 0;/Users/user/voodoohda.googlecode.com SVN/Parser.cpp:1028:0 /Users/user/voodoohda.googlecode.com SVN/Parser.cpp:1028: error: assignment of read-only location



andyvand

  • VoodooLabs
  • Posts: 51
Re: "deprecated conversion" Error with VoodooHDA on 10.6
« Reply #7 on: February 25, 2010, 07:42:37 PM »
Zip the sources and mail them to me on the following e-mail addres:
andyvand@gmail.com
I'll see what I can do for you...

andyvand

  • VoodooLabs
  • Posts: 51
Re: "deprecated conversion" Error with VoodooHDA on 10.6
« Reply #8 on: March 19, 2010, 06:39:32 PM »
Just look in my sources (One back, the one for Tiger, Leopard and Snow Leopard) to see how I fixed that issue...
It won't be much trouble to apply the same to latest SVN...