summaryrefslogtreecommitdiff
authoralwin <alwin>2004-02-27 23:29:32 (UTC)
committer alwin <alwin>2004-02-27 23:29:32 (UTC)
commit5d508c3d19bfe4f0840f43d7c221db4c3cc8cfad (patch) (unidiff)
tree4e641b1ef1aa28d95f56066413f4c548415cc6b3
parent2b2f507809e55267bf8b2700d36fcab51b03f86a (diff)
downloadopie-5d508c3d19bfe4f0840f43d7c221db4c3cc8cfad.zip
opie-5d508c3d19bfe4f0840f43d7c221db4c3cc8cfad.tar.gz
opie-5d508c3d19bfe4f0840f43d7c221db4c3cc8cfad.tar.bz2
small bugfix so it compiles with arm-linux-gcc
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/contrib/dhry.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/sysinfo/contrib/dhry.c b/noncore/settings/sysinfo/contrib/dhry.c
index d1dadbd..20b627c 100644
--- a/noncore/settings/sysinfo/contrib/dhry.c
+++ b/noncore/settings/sysinfo/contrib/dhry.c
@@ -404,193 +404,193 @@ double dtime()
404#include <sys/time.h> 404#include <sys/time.h>
405#include <sys/resource.h> 405#include <sys/resource.h>
406#include <sys/rusage.h> 406#include <sys/rusage.h>
407 407
408#ifdef __hpux 408#ifdef __hpux
409#include <sys/syscall.h> 409#include <sys/syscall.h>
410#endif 410#endif
411 411
412struct rusage rusage; 412struct rusage rusage;
413 413
414double dtime() 414double dtime()
415{ 415{
416 double q; 416 double q;
417 417
418 getrusage(RUSAGE_SELF,&rusage); 418 getrusage(RUSAGE_SELF,&rusage);
419 419
420 q = (double)(rusage.ru_utime.tv_sec); 420 q = (double)(rusage.ru_utime.tv_sec);
421 q = q + (double)(rusage.ru_utime.tv_nsec) * 1.0e-09; 421 q = q + (double)(rusage.ru_utime.tv_nsec) * 1.0e-09;
422 422
423 return q; 423 return q;
424} 424}
425#endif 425#endif
426 426
427 427
428/****************************************************/ 428/****************************************************/
429/* Windows NT (32 bit) dtime() routine */ 429/* Windows NT (32 bit) dtime() routine */
430/* Provided by: Piers Haken, piersh@microsoft.com */ 430/* Provided by: Piers Haken, piersh@microsoft.com */
431/****************************************************/ 431/****************************************************/
432#ifdef WIN32 432#ifdef WIN32
433#include <windows.h> 433#include <windows.h>
434 434
435double dtime(void) 435double dtime(void)
436{ 436{
437 double q; 437 double q;
438 438
439 q = (double)GetTickCount() * 1.0e-03; 439 q = (double)GetTickCount() * 1.0e-03;
440 440
441 return q; 441 return q;
442} 442}
443#endif 443#endif
444 444
445/*****************************************************/ 445/*****************************************************/
446/* Time according to POSIX.1 - <J.Pelan@qub.ac.uk> */ 446/* Time according to POSIX.1 - <J.Pelan@qub.ac.uk> */
447/* Ref: "POSIX Programmer's Guide" O'Reilly & Assoc.*/ 447/* Ref: "POSIX Programmer's Guide" O'Reilly & Assoc.*/
448/*****************************************************/ 448/*****************************************************/
449#ifdef POSIX1 449#ifdef POSIX1
450#define _POSIX_SOURCE 1 450#define _POSIX_SOURCE 1
451#include <unistd.h> 451#include <unistd.h>
452#include <limits.h> 452#include <limits.h>
453#include <sys/times.h> 453#include <sys/times.h>
454 454
455struct tms tms; 455struct tms tms;
456 456
457double dtime() 457double dtime()
458{ 458{
459 double q; 459 double q;
460 times(&tms); 460 times(&tms);
461 q = (double)tms.tms_utime / (double)CLK_TCK; 461 q = (double)tms.tms_utime / (double)CLK_TCK;
462 return q; 462 return q;
463} 463}
464#endif 464#endif
465/* 465/*
466 ************************************************************************* 466 *************************************************************************
467 * 467 *
468 * "DHRYSTONE" Benchmark Program 468 * "DHRYSTONE" Benchmark Program
469 * ----------------------------- 469 * -----------------------------
470 * 470 *
471 * Version: C, Version 2.1 471 * Version: C, Version 2.1
472 * 472 *
473 * File: dhry_1.c (part 2 of 3) 473 * File: dhry_1.c (part 2 of 3)
474 * 474 *
475 * Date: May 25, 1988 475 * Date: May 25, 1988
476 * 476 *
477 * Author: Reinhold P. Weicker 477 * Author: Reinhold P. Weicker
478 * 478 *
479 ************************************************************************* 479 *************************************************************************
480 */ 480 */
481 481
482#include <stdio.h> 482#include <stdio.h>
483#include <stdlib.h> 483#include <stdlib.h>
484#include <string.h> 484#include <string.h>
485#include "dhry.h" 485#include "dhry.h"
486 486
487/* Global Variables: */ 487/* Global Variables: */
488 488
489Rec_Pointer Ptr_Glob, 489Rec_Pointer Ptr_Glob,
490 Next_Ptr_Glob; 490 Next_Ptr_Glob;
491int Int_Glob; 491int Int_Glob;
492Boolean Bool_Glob; 492Boolean Bool_Glob;
493char Ch_1_Glob, 493char Ch_1_Glob,
494 Ch_2_Glob; 494 Ch_2_Glob;
495int Arr_1_Glob [50]; 495int Arr_1_Glob [50];
496int Arr_2_Glob [50] [50]; 496int Arr_2_Glob [50] [50];
497 497
498char Reg_Define[] = "Register option selected."; 498char Reg_Define[] = "Register option selected.";
499 499
500extern char *malloc (); 500//extern char *malloc ();
501Enumeration Func_1 (); 501Enumeration Func_1 ();
502 /* 502 /*
503 forward declaration necessary since Enumeration may not simply be int 503 forward declaration necessary since Enumeration may not simply be int
504 */ 504 */
505 505
506#ifndef ROPT 506#ifndef ROPT
507#define REG 507#define REG
508 /* REG becomes defined as empty */ 508 /* REG becomes defined as empty */
509 /* i.e. no register variables */ 509 /* i.e. no register variables */
510#else 510#else
511#define REG register 511#define REG register
512#endif 512#endif
513 513
514 514
515/* variables for time measurement: */ 515/* variables for time measurement: */
516 516
517#define Too_Small_Time 2 517#define Too_Small_Time 2
518 /* Measurements should last at least 2 seconds */ 518 /* Measurements should last at least 2 seconds */
519 519
520double Begin_Time, 520double Begin_Time,
521 End_Time, 521 End_Time,
522 User_Time; 522 User_Time;
523 523
524double Microseconds, 524double Microseconds,
525 Dhrystones_Per_Second, 525 Dhrystones_Per_Second,
526 Vax_Mips; 526 Vax_Mips;
527 527
528/* end of variables for time measurement */ 528/* end of variables for time measurement */
529 529
530/**********************************************************************************************/ 530/**********************************************************************************************/
531 531
532 532
533Proc_1 (Ptr_Val_Par) 533Proc_1 (Ptr_Val_Par)
534/******************/ 534/******************/
535 535
536REG Rec_Pointer Ptr_Val_Par; 536REG Rec_Pointer Ptr_Val_Par;
537 /* executed once */ 537 /* executed once */
538{ 538{
539 REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp; 539 REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
540 /* == Ptr_Glob_Next */ 540 /* == Ptr_Glob_Next */
541 /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */ 541 /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */
542 /* corresponds to "rename" in Ada, "with" in Pascal */ 542 /* corresponds to "rename" in Ada, "with" in Pascal */
543 543
544 structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob); 544 structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
545 Ptr_Val_Par->variant.var_1.Int_Comp = 5; 545 Ptr_Val_Par->variant.var_1.Int_Comp = 5;
546 Next_Record->variant.var_1.Int_Comp 546 Next_Record->variant.var_1.Int_Comp
547 = Ptr_Val_Par->variant.var_1.Int_Comp; 547 = Ptr_Val_Par->variant.var_1.Int_Comp;
548 Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp; 548 Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
549 Proc_3 (&Next_Record->Ptr_Comp); 549 Proc_3 (&Next_Record->Ptr_Comp);
550 /* Ptr_Val_Par->Ptr_Comp->Ptr_Comp 550 /* Ptr_Val_Par->Ptr_Comp->Ptr_Comp
551 == Ptr_Glob->Ptr_Comp */ 551 == Ptr_Glob->Ptr_Comp */
552 if (Next_Record->Discr == Ident_1) 552 if (Next_Record->Discr == Ident_1)
553 /* then, executed */ 553 /* then, executed */
554 { 554 {
555 Next_Record->variant.var_1.Int_Comp = 6; 555 Next_Record->variant.var_1.Int_Comp = 6;
556 Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp, 556 Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
557 &Next_Record->variant.var_1.Enum_Comp); 557 &Next_Record->variant.var_1.Enum_Comp);
558 Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp; 558 Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
559 Proc_7 (Next_Record->variant.var_1.Int_Comp, 10, 559 Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
560 &Next_Record->variant.var_1.Int_Comp); 560 &Next_Record->variant.var_1.Int_Comp);
561 } 561 }
562 else /* not executed */ 562 else /* not executed */
563 structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp); 563 structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
564} /* Proc_1 */ 564} /* Proc_1 */
565 565
566 566
567Proc_2 (Int_Par_Ref) 567Proc_2 (Int_Par_Ref)
568/******************/ 568/******************/
569 /* executed once */ 569 /* executed once */
570 /* *Int_Par_Ref == 1, becomes 4 */ 570 /* *Int_Par_Ref == 1, becomes 4 */
571 571
572One_Fifty *Int_Par_Ref; 572One_Fifty *Int_Par_Ref;
573{ 573{
574 One_Fifty Int_Loc; 574 One_Fifty Int_Loc;
575 Enumeration Enum_Loc; 575 Enumeration Enum_Loc;
576 576
577 Int_Loc = *Int_Par_Ref + 10; 577 Int_Loc = *Int_Par_Ref + 10;
578 do /* executed once */ 578 do /* executed once */
579 if (Ch_1_Glob == 'A') 579 if (Ch_1_Glob == 'A')
580 /* then, executed */ 580 /* then, executed */
581 { 581 {
582 Int_Loc -= 1; 582 Int_Loc -= 1;
583 *Int_Par_Ref = Int_Loc - Int_Glob; 583 *Int_Par_Ref = Int_Loc - Int_Glob;
584 Enum_Loc = Ident_1; 584 Enum_Loc = Ident_1;
585 } /* if */ 585 } /* if */
586 while (Enum_Loc != Ident_1); /* true */ 586 while (Enum_Loc != Ident_1); /* true */
587} /* Proc_2 */ 587} /* Proc_2 */
588 588
589 589
590Proc_3 (Ptr_Ref_Par) 590Proc_3 (Ptr_Ref_Par)
591/******************/ 591/******************/
592 /* executed once */ 592 /* executed once */
593 /* Ptr_Ref_Par becomes Ptr_Glob */ 593 /* Ptr_Ref_Par becomes Ptr_Glob */
594 594
595Rec_Pointer *Ptr_Ref_Par; 595Rec_Pointer *Ptr_Ref_Par;
596 596