refclock_jupiter.c (56746) | refclock_jupiter.c (82498) |
---|---|
1/* 2 * Copyright (c) 1997, 1998 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#ifdef HAVE_CONFIG_H 35# include <config.h> 36#endif 37 38#if defined(REFCLOCK) && defined(CLOCK_JUPITER) && defined(PPS) 39 | 1/* 2 * Copyright (c) 1997, 1998 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 32 */ 33 34#ifdef HAVE_CONFIG_H 35# include <config.h> 36#endif 37 38#if defined(REFCLOCK) && defined(CLOCK_JUPITER) && defined(PPS) 39 |
40#include <stdio.h> 41#include <ctype.h> 42#include <sys/time.h> 43 | |
44#include "ntpd.h" 45#include "ntp_io.h" 46#include "ntp_refclock.h" 47#include "ntp_unixtime.h" 48#include "ntp_stdlib.h" 49#include "ntp_calendar.h" 50 | 40#include "ntpd.h" 41#include "ntp_io.h" 42#include "ntp_refclock.h" 43#include "ntp_unixtime.h" 44#include "ntp_stdlib.h" 45#include "ntp_calendar.h" 46 |
47#include <stdio.h> 48#include <ctype.h> 49 |
|
51#include "jupiter.h" 52 53#include <sys/ppsclock.h> 54 55#ifdef XNTP_BIG_ENDIAN 56#define getshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) 57#define putshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) 58#else --- 617 unchanged lines hidden (view full) --- 676 pp = peer->procptr; 677 up = (struct jupiterunit *)pp->unitptr; 678 679 /* 680 * Copy the raw offsets and sort into ascending order 681 */ 682 for (i = 0; i < NSAMPLES; i++) 683 off[i] = up->filter[i]; | 50#include "jupiter.h" 51 52#include <sys/ppsclock.h> 53 54#ifdef XNTP_BIG_ENDIAN 55#define getshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) 56#define putshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) 57#else --- 617 unchanged lines hidden (view full) --- 675 pp = peer->procptr; 676 up = (struct jupiterunit *)pp->unitptr; 677 678 /* 679 * Copy the raw offsets and sort into ascending order 680 */ 681 for (i = 0; i < NSAMPLES; i++) 682 off[i] = up->filter[i]; |
684 qsort((char *)off, NSAMPLES, sizeof(l_fp), jupiter_cmpl_fp); | 683 qsort((char *)off, (size_t)NSAMPLES, sizeof(l_fp), jupiter_cmpl_fp); |
685 686 /* 687 * Reject the furthest from the median of NSAMPLES samples until 688 * NKEEP samples remain. 689 */ 690 i = 0; 691 n = NSAMPLES; 692 while ((n - i) > up->nkeep) { --- 571 unchanged lines hidden --- | 684 685 /* 686 * Reject the furthest from the median of NSAMPLES samples until 687 * NKEEP samples remain. 688 */ 689 i = 0; 690 n = NSAMPLES; 691 while ((n - i) > up->nkeep) { --- 571 unchanged lines hidden --- |