LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-15-2015, 06:53 PM   #1
Ace Blackwell
Member
 
Registered: Mar 2004
Location: Kentucky, USA
Distribution: SlamD 12.1 / Slack 12.0 ~ 14.2_64
Posts: 345

Rep: Reputation: 54
Passing to Function


All,

I'm using Eclipse Helios on Slackware 14.0. I'm also using Allegro 4.2. The issue I'm getting is the dreaded Allegro Signal #11. I know it has to do with a new function I've created because I can turn it on and off by commenting the function call out. The only thing i can think of is the called function gets 3 pointers passed to it that originally come from another function. IE

main(){
FunctA(W,X,Y,Z)
}

FunctA(W,X,Y,Z){
Do stuff
FunctB(Z,Y,X)
}

FunctB(Z,Y,X){
do stuff
}

My question is, if FunctA() is receiving the parameters in WXYZ order, Even though FunctB() doesn't use all 4 parameters do the ones that are being passed need to be in the same order?

Thanks
Ace
 
Old 08-16-2015, 02:10 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
The answer to your question should be no.

The question you need to ask is, Have you changed the pointers in some way from the start of FunctA to when you call FunctB?
 
Old 08-16-2015, 10:26 AM   #3
Ace Blackwell
Member
 
Registered: Mar 2004
Location: Kentucky, USA
Distribution: SlamD 12.1 / Slack 12.0 ~ 14.2_64
Posts: 345

Original Poster
Rep: Reputation: 54
You were right. I rearranged parameters and it didn't matter. And yes I think I was messing the pointers up some how as I had a recursive call and didn't see it for a the longest time. Solution was to take the section I needed from the called function and create a smaller function. Probably not the most Politically Correct way to solve the problem but it worked and is easier to understand / debug.

thanks for the input
Ace
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing data from interrupt handler function to tasklet function in kernel programmin double-out Programming 2 05-18-2010 10:10 PM
Passing display to function in C aatwell Programming 11 11-26-2007 02:06 AM
Passing one php function result as a parameter to another php function davee Programming 13 09-12-2004 12:08 PM
A main can be changed by a function local without passing anything to the function? ananthbv Programming 10 05-04-2004 01:31 PM
passing a string to a function jkobrien Programming 8 11-05-2003 01:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration