This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ada] fix unaligned access


The "OS_Time" type in g-os_lib.ads is of type Integer, and makes
no attempt to match up with the POSIX time_t.  Since there does
not appear to be a proper exported time_t in any of the system
packages, it seems easier to just go ahead with Integer and do
the time_t frobbing in C.

Ok?


r~


	* adaint.c (__gnat_to_gm_time): First arg is int, not time_t.
	* adaint.h (__gnat_to_gm_time): Update prototype.

Index: adaint.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/adaint.c,v
retrieving revision 1.6
diff -c -p -d -r1.6 adaint.c
*** adaint.c	2001/12/16 00:56:17	1.6
--- adaint.c	2002/02/06 20:50:58
*************** const char *__gnat_library_template = GN
*** 212,219 ****
  
  void
  __gnat_to_gm_time (p_time, p_year, p_month, p_day, p_hours, p_mins, p_secs)
!      time_t *p_time;
!      int *p_year, *p_month, *p_day, *p_hours, *p_mins, *p_secs;
  {
    struct tm *res;
    time_t time = *p_time;
--- 212,218 ----
  
  void
  __gnat_to_gm_time (p_time, p_year, p_month, p_day, p_hours, p_mins, p_secs)
!      int *p_time, *p_year, *p_month, *p_day, *p_hours, *p_mins, *p_secs;
  {
    struct tm *res;
    time_t time = *p_time;
Index: adaint.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/adaint.h,v
retrieving revision 1.4
diff -c -p -d -r1.4 adaint.h
*** adaint.h	2001/12/04 16:37:55	1.4
--- adaint.h	2002/02/06 20:50:58
***************
*** 34,40 ****
  
  #include <dirent.h>
  
! extern void   __gnat_to_gm_time			   PARAMS ((time_t *, int *,
  							    int *, int *,
  							    int *, int *,
  							    int *));
--- 34,40 ----
  
  #include <dirent.h>
  
! extern void   __gnat_to_gm_time			   PARAMS ((int *, int *,
  							    int *, int *,
  							    int *, int *,
  							    int *));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]