diff --git a/ev.3 b/ev.3 index 963bdfd..1fdfe55 100644 --- a/ev.3 +++ b/ev.3 @@ -261,14 +261,17 @@ you actually want to know. .IP "int ev_version_minor ()" 4 .IX Item "int ev_version_minor ()" .PD -You can find out the major and minor version numbers of the library +You can find out the major and minor \s-1API/ABI\s0 version numbers of the library you linked against by calling the functions \f(CW\*(C`ev_version_major\*(C'\fR and \&\f(CW\*(C`ev_version_minor\*(C'\fR. If you want, you can compare against the global symbols \f(CW\*(C`EV_VERSION_MAJOR\*(C'\fR and \f(CW\*(C`EV_VERSION_MINOR\*(C'\fR, which specify the version of the library your program was compiled against. .Sp +These version numbers refer to the \s-1API\s0 and \s-1ABI\s0 version of the library, not +the release version. +.Sp Usually, it's a good idea to terminate if the major versions mismatch, -as this indicates an incompatible change. Minor versions are usually +as this indicates an incompatible change. Minor versions are usually compatible to older versions, so a larger minor version alone is usually not a problem. .Sp diff --git a/ev.c b/ev.c index 823b68c..3fc528a 100644 --- a/ev.c +++ b/ev.c @@ -1239,7 +1239,7 @@ periodics_reify (EV_P) } else if (w->interval) { - ((WT)w)->at += floor ((ev_rt_now - ((WT)w)->at) / w->interval + 1.) * w->interval; + ((WT)w)->at = w->offset + floor ((ev_rt_now - w->offset) / w->interval + 1.) * w->interval; assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now)); downheap ((WT *)periodics, periodiccnt, 0); } @@ -1263,7 +1263,7 @@ periodics_reschedule (EV_P) if (w->reschedule_cb) ((WT)w)->at = w->reschedule_cb (w, ev_rt_now); else if (w->interval) - ((WT)w)->at += ceil ((ev_rt_now - ((WT)w)->at) / w->interval) * w->interval; + ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; } /* now rebuild the heap */ @@ -1692,8 +1692,10 @@ ev_periodic_start (EV_P_ ev_periodic *w) { assert (("ev_periodic_start called with negative interval value", w->interval >= 0.)); /* this formula differs from the one in periodic_reify because we do not always round up */ - ((WT)w)->at += ceil ((ev_rt_now - ((WT)w)->at) / w->interval) * w->interval; + ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; } + else + ((WT)w)->at = w->offset; ev_start (EV_A_ (W)w, ++periodiccnt); array_needsize (ev_periodic *, periodics, periodicmax, periodiccnt, EMPTY2); diff --git a/ev.h b/ev.h index fa4c6c7..c4b843e 100644 --- a/ev.h +++ b/ev.h @@ -119,8 +119,8 @@ struct ev_loop; # define EV_PROTOTYPES 1 #endif -#define EV_VERSION_MAJOR 1 -#define EV_VERSION_MINOR 1 +#define EV_VERSION_MAJOR 2 +#define EV_VERSION_MINOR 0 #ifndef EV_CB_DECLARE # define EV_CB_DECLARE(type) void (*cb)(EV_P_ struct type *w, int revents); diff --git a/ev.html b/ev.html index e1af75a..f63538f 100644 --- a/ev.html +++ b/ev.html @@ -6,7 +6,7 @@ - +
@@ -187,13 +187,13 @@ you actually want to know.You can find out the major and minor API/ABI version numbers of the library +
You can find out the major and minor ABI version numbers of the library
you linked against by calling the functions ev_version_major
and
ev_version_minor
. If you want, you can compare against the global
symbols EV_VERSION_MAJOR
and EV_VERSION_MINOR
, which specify the
version of the library your program was compiled against.
These version numbers refer to the API and ABI version of the library, not -the release version.
+These version numbers refer to the ABI version of the library, not the +release version.
Usually, it's a good idea to terminate if the major versions mismatch,
as this indicates an incompatible change. Minor versions are usually
compatible to older versions, so a larger minor version alone is usually
diff --git a/ev.pod b/ev.pod
index 0657b7f..063c01d 100644
--- a/ev.pod
+++ b/ev.pod
@@ -119,14 +119,14 @@ you actually want to know.
=item int ev_version_minor ()
-You can find out the major and minor API/ABI version numbers of the library
+You can find out the major and minor ABI version numbers of the library
you linked against by calling the functions C