POV-Ray : Newsgroups : povray.general : Algorithm-approach to eliminate intersections... : Re: Algorithm-approach to eliminate intersections... Server Time
6 Aug 2024 08:14:47 EDT (-0400)
  Re: Algorithm-approach to eliminate intersections...  
From: Warp
Date: 23 Jun 2002 08:37:57
Message: <3d15c125@news.povray.org>
Apache <apa### [at] yahoocom> wrote:
> All my C/C++ code is ANSI, so it compiles on all platforms without too much
> tweaking.

  C/C++ code conforming to the ANSI standard doesn't necessarily mean
that it will work in all platforms (or even in more than one specific
platform).

  For example there's nothing against the standard in the following code:

void PutPixel(int x, int y, unsigned char color)
{
  unsigned char* screen = (unsigned char*)0xA0000;
  screen[x+y*320] = color;
}

  However, in most systems it will just cause a segmentation fault, and even
if it doesn't, it certainly will not work as expected.

  Also some things cause surprises among the unaware coders:

char table[10];
int* ptr = (int*)(&table[1]);
*ptr = 5;

  This works ok in some systems (eg. Intel) but in most RISC processors it
causes a bus error (ie. the program crashes).

  Conforming to the standard is not enough to make portable code.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.