From: Wolfgang K. <wol...@xm...> - 2009-10-11 07:09:40
|
Did you run the ant script to rebuild the library jars after implementing these Math methods? If yes - please send me a patch file with your implementation so that it is a little bit easier for me to add things to my workspace. Then I will have a look at what's going wrong and come back to as soon as possible. -- Wolfgang Joseph Rukshan Fonseka wrote: > Ok I added these to java_lang_Math.m > + (float) pow___float: (float) x : (float) y > { > return pow(x, y); > } > > + (double) pow___double: (double) x : (double) y > { > return pow(x, y); > } > + (float) max___float_float :(float) x :(float) y > { > return x < y ? y : x; > } > > + (double) max___double_double :(double) x :(double) y > { > return x < y ? y : x; > } > > + (int) max___int_int :(int) x :(int) y > { > return x < y ? y : x; > } > > + (float) min___float_float :(float) x :(float) y > { > return x > y ? y : x; > } > > + (double) min___double_double :(double) x :(double) y > { > return x > y ? y : x; > } > > + (int) min___int_int :(int) x :(int) y > { > return x > y ? y : x; > } > > and corresponding prototypes to the header file. > > However this android code: > public class ImageViewer extends Activity { > /** Called when the activity is first created. */ > @SuppressWarnings("deprecation") > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > > > > AbsoluteLayout layout = new AbsoluteLayout(this); > layout.setLayoutParams(new > LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); > ImageView viewer = new ImageView(this); > viewer.setImageResource(R.drawable.cat); > layout.addView(viewer, new > AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT, > AbsoluteLayout.LayoutParams.WRAP_CONTENT, 0, 100)); > TextView text = new TextView(this); > layout.addView(text, new > AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT, > AbsoluteLayout.LayoutParams.WRAP_CONTENT, 0, 0)); > setContentView(layout); > > > Math.pow(1.5,2*5); > Math.min(1.2, 3.0); > Math.max(3.4, 4.5); > } > } > > However cross compiling to iphone give me this error message: > com_home_imageviewer_ImageViewer.m:131: warning: ‘java_lang_Math’ may > not respond to ‘+pow___double_double::’ > com_home_imageviewer_ImageViewer.m:131: warning: (Messages without a > matching method signature > com_home_imageviewer_ImageViewer.m:131: warning: will be assumed to > return ‘id’ and accept > com_home_imageviewer_ImageViewer.m:131: warning: ‘...’ as arguments.) > com_home_imageviewer_ImageViewer.m:131: error: incompatible types in > assignment > com_home_imageviewer_ImageViewer.m:133: warning: implicit declaration > of function ‘ERROR’ > > > I am pretty confident it is due to the Math functions I am calling at > the end of my activity. Any idea what I am doing wrong? > > > On 09/10/2009, at 2:48 AM, Joseph Rukshan Fonseka wrote: > >> Ok I tried to convert an android application to iphone and noticed >> quite a few of the Maths functions don't compile such as >> >> Math.max() >> Math.min() >> Math.pow() >> >> I am guessing they aren't supported yet? I would like to extend the >> Maths library to have these functions. Which file should I be looking >> at to add these? >> >> Regards, >> Rukshan Fonseka. >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and >> stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> xmlvm-users mailing list >> xml...@li... >> <mailto:xml...@li...> >> https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > ------------------------------------------------------------------------ > > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > |