if (width<=0 || height<=0 || width<0 || height<0)
if (width<=0 || height<=0)
void Java_vdr_mhp_awt_MHPNativeGraphics_drawArc(JNIEnv* env, jobject obj, jlong nativeData, jlong nativeFlipData, jint x, jint y, jint width, jint height, jint startAngle, jint arcAngle) {   IDirectFBSurface *surface=((IDirectFBSurface *)nativeData);      if (width<=0 || height<=0 || width<0 || height<0)      return;   if (x<0)      x=0;   if (y<0)      y=0;   if (arcAngle==0) //negative values are okay      return;   if (startAngle < 0)      startAngle = -startAngle;   if (startAngle > 360)      startAngle = startAngle%360;         //libxmi operations   miPixel pixels[2];   miGC *pGC;   miPaintedSet *paintedSet;   miEllipseCache *cache;   miArc arcs[1];      pixels[0]=0; // pixel value for `off' dashes, if drawn   pixels[1]=1; // default pixel for drawing   pGC = miNewGC(2, pixels);   paintedSet = miNewPaintedSet();   cache = miNewEllipseCache();      arcs[0].x=x;   arcs[0].y=y;   arcs[0].width=width;   arcs[0].height=height;   arcs[0].angle1=startAngle*64; //starting angle, in 1/64 degrees, counterclockwise from x-axis   arcs[0].angle2=arcAngle*64; //angle range, in 1/64 degrees         miDrawArcs_r(paintedSet, pGC, 1, arcs, cache);     miDeleteEllipseCache(cache);      //do the actual drawing   try {      surface->SetDrawingFlags(DSDRAW_BLEND);            //translate the point structures of the paintedSet to the surface's pixels      for (int i = 0; i < paintedSet->ngroups; i++) {         if (paintedSet->groups[i]->group[0].count > 0) {            if (paintedSet->groups[i]->pixel) {               for (int u=0;u<paintedSet->groups[i]->group[0].count;u++) {                                 surface->DrawLine(paintedSet->groups[i]->group[0].points[u].x,                                    paintedSet->groups[i]->group[0].points[u].y,                                    paintedSet->groups[i]->group[0].points[u].x + paintedSet->groups[i]->group[0].widths[u],                                    paintedSet->groups[i]->group[0].points[u].y);               }            }         }      }         } catch (DFBException *e) {      printf("DirectFB: Error %s, %s\n", e->GetAction(), e->GetResult());      miDeleteGC (pGC);      miDeletePaintedSet (paintedSet);      delete e;      return;   }   ((FlipData *)nativeFlipData)->addUpdate(x, y, x+width+1, y+height+1);   miDeleteGC (pGC);   miDeletePaintedSet (paintedSet);}