/*ident "@(#)Time:Duration.c 3.1" */ /****************************************************************************** * * C++ Standard Components, Release 3.0. * * Copyright (c) 1991, 1992 AT&T and Unix System Laboratories, Inc. * Copyright (c) 1988, 1989, 1990 AT&T. All Rights Reserved. * * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T and Unix System * Laboratories, Inc. The copyright notice above does not evidence * any actual or intended publication of such source code. * ******************************************************************************/ #include "Timelib.h" #ifndef __GNUG__ static inline long abs(long i){ return i>=0 ?i :-i; } #endif Duration abs(const Duration& d){ if(d= 24*60*60){ Duration::string_objection.raise( "Duration::string_objection raised" ); result.ss=0; }else{ result.ss=temp_t; } Time::string_objection.appoint(old_action); return result; } double operator/( const Duration& left, const Duration& right ){ double result; result=double(left.ss)/double(right.ss); return result; } static int default_action(const char* msg){ write(2, msg, strlen(msg)); write(2, "\n", 1); abort(); return 0; // to avoid compiler message } Objection Duration::string_objection(default_action);