Index: branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_igs.c
===================================================================
--- branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_igs.c	(revision 8992)
+++ branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_igs.c	(revision 8997)
@@ -17,5 +17,4 @@
 #endif
 #include <clock_orbit_igs.h>
-
 
 static uint32_t CRC24(long size, const unsigned char *buf) {
@@ -132,4 +131,5 @@
 #define T_MW_CONSISTENCY_INDICATOR(a)    ADDBITS( 1, a)                  /* DF487, IDF033 */
 
+/* URA */
 #define T_SSR_URA(a)                     ADDBITS( 6, a)                  /* DF389, IDF034 */
 
@@ -547,4 +547,5 @@
 #define G_PHASE_BIAS(a)                  GETFLOATSIGN(a, 20, 1/10000.)     /* DF482, IDF028 */
 
+/* Phase specific part of GNSS phase bias message */
 #define G_INTEGER_INDICATOR(a)           GETBITS(a,  1)                    /* DF483, IDF029 */
 #define G_WIDE_LANE_INDICATOR(a)         GETBITS(a,  2)                    /* DF484, IDF030 */
@@ -553,4 +554,5 @@
 #define G_MW_CONSISTENCY_INDICATOR(a)    GETBITS(a,  1)                    /* DF487, IDF033 */
 
+/* URA */
 #define G_SSR_URA(a)                     {int temp; GETBITS(temp, 6) \
  (a) = URAToValue(temp);}                                                  /* DF389, IDF034 */
Index: branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.c
===================================================================
--- branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.c	(revision 8992)
+++ branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.c	(revision 8997)
@@ -89,10 +89,20 @@
 #define MPI         3.141592653589793
 
-/* GPS macros also used for other systems when matching! */
+/* GNSS macros - Header part */
 #define T_RTCM_MESSAGE_NUMBER(a)         ADDBITS(12, a)      /* DF002 */
+#define T_GPS_EPOCH_TIME(a)              ADDBITS(20, a)
+#define T_GLONASS_EPOCH_TIME(a)          ADDBITS(17, a)
+#define T_SSR_UPDATE_INTERVAL(a)         ADDBITS( 4, a)
+#define T_MULTIPLE_MESSAGE_INDICATOR(a)  ADDBITS( 1, a)
+#define T_SATELLITE_REFERENCE_DATUM(a)   ADDBITS( 1, a)
+#define T_SSR_IOD(a)                     ADDBITS( 4, a)
+#define T_SSR_PROVIDER_ID(a)             ADDBITS(16, a)
+#define T_SSR_SOLUTION_ID(a)             ADDBITS( 4, a)
+#define T_NO_OF_SATELLITES(a)            ADDBITS( 6, a)
+
+/* GNSS macros - Satellite specific part */
 #define T_GPS_SATELLITE_ID(a)            ADDBITS( 6, a)      /* DF068 */
 #define T_QZSS_SATELLITE_ID(a)           ADDBITS( 4, a)      /* DF249 */
 #define T_GLONASS_SATELLITE_ID(a)        ADDBITS( 5, a)
-
 #define T_GPS_IODE(a)                    ADDBITS( 8, a)      /* DF071 */
 #define T_GLONASS_IOD(a)                 ADDBITS( 8, a)      /* DF239 */
@@ -102,5 +112,4 @@
 #define T_BDS_TOEMOD(a)                  ADDBITS(10, (a/8))  /* DF470 */
 #define T_BDS_IOD(a)                     ADDBITS( 8, a)      /* DF471 */
-
 #define T_DELTA_RADIAL(a)                SCALEADDBITS(22,    10000.0, a)
 #define T_DELTA_ALONG_TRACK(a)           SCALEADDBITS(20,     2500.0, a)
@@ -110,8 +119,9 @@
 #define T_DELTA_DOT_CROSS_TRACK(a)       SCALEADDBITS(19,   250000.0, a)
 
-#define T_SATELLITE_REFERENCE_DATUM(a)   ADDBITS(1, a)
 #define T_DELTA_CLOCK_C0(a)              SCALEADDBITS(22,    10000.0, a)
 #define T_DELTA_CLOCK_C1(a)              SCALEADDBITS(21,  1000000.0, a)
 #define T_DELTA_CLOCK_C2(a)              SCALEADDBITS(27, 50000000.0, a)
+#define T_HR_CLOCK_CORRECTION(a)         SCALEADDBITS(22,    10000.0, a)
+
 #define T_NO_OF_CODE_BIASES(a)           ADDBITS( 5, a)
 #define T_NO_OF_PHASE_BIASES(a)          ADDBITS( 5, a)
@@ -122,27 +132,21 @@
 #define T_PHASE_BIAS(a)                  SCALEADDBITS(20,    10000.0, a)
 
-#define T_GPS_EPOCH_TIME(a)              ADDBITS(20, a)
-#define T_GLONASS_EPOCH_TIME(a)          ADDBITS(17, a)
-#define T_NO_OF_SATELLITES(a)            ADDBITS( 6, a)
-#define T_MULTIPLE_MESSAGE_INDICATOR(a)  ADDBITS( 1, a)
-#define T_DISPERSIVE_BIAS_INDICATOR(a)   ADDBITS( 1, a)
-#define T_MW_CONSISTENCY_INDICATOR(a)    ADDBITS( 1, a)
+/* Phase specific part of GNSS phase bias message */
 #define T_INTEGER_INDICATOR(a)           ADDBITS( 1, a)
 #define T_WIDE_LANE_INDICATOR(a)         ADDBITS( 2, a)
 #define T_DISCONTINUITY_COUNTER(a)       ADDBITS( 4, a)
+#define T_DISPERSIVE_BIAS_INDICATOR(a)   ADDBITS( 1, a)
+#define T_MW_CONSISTENCY_INDICATOR(a)    ADDBITS( 1, a)
+
+/* URA */
 #define T_SSR_URA(a)                     ADDBITS( 6, a)
-#define T_HR_CLOCK_CORRECTION(a)         SCALEADDBITS(22,    10000.0, a)
-#define T_SSR_UPDATE_INTERVAL(a)         ADDBITS( 4, a)
-
-#define T_SSR_IOD(a)                     ADDBITS( 4, a)
-#define T_SSR_PROVIDER_ID(a)             ADDBITS(16, a)
-#define T_SSR_SOLUTION_ID(a)             ADDBITS( 4, a)
-
+
+/* Ionosphere */
 #define T_NO_IONO_LAYERS(a)              ADDBITS( 2, a-1)
-#define T_VTEC_QUALITY_INDICATOR(a)      SCALEADDBITS( 9,       20.0, a)
-#define T_IONO_COEFF(a)                  SCALEADDBITS(16,      200.0, a)
+#define T_IONO_HEIGHT(a)                 SCALEADDBITS( 8,   1/10000.0, a)
 #define T_IONO_DEGREE(a)                 ADDBITS( 4, a-1)
 #define T_IONO_ORDER(a)                  ADDBITS( 4, a-1)
-#define T_IONO_HEIGHT(a)                 SCALEADDBITS( 8,   1/10000.0, a)
+#define T_IONO_COEFF(a)                  SCALEADDBITS(16,      200.0, a)
+#define T_VTEC_QUALITY_INDICATOR(a)      SCALEADDBITS( 9,       20.0, a)
 
 static double URAToValue(int ura) {
@@ -612,5 +616,4 @@
     INITBLOCK
   T_RTCM_MESSAGE_NUMBER(VTEC_BASE)
-
   T_GPS_EPOCH_TIME(v->EpochTime)
   T_SSR_UPDATE_INTERVAL(v->UpdateInterval)
@@ -648,6 +651,5 @@
 
 #define LOADBITS(a) { \
-  while((a) > numbits) \
-  { \
+  while((a) > numbits) { \
     if(!size--) return GCOBR_SHORTMESSAGE; \
     bitbuffer = (bitbuffer<<8)|((unsigned char)*(buffer++)); \
@@ -690,22 +692,35 @@
 #define SKIPBITS(b) { LOADBITS(b) numbits -= (b); }
 
-/* GPS macros also used for other systems when matching! */
-#define G_HEADER(a)                      GETBITS(a,8)
-#define G_RESERVEDH(a)                   GETBITS(a,6)
+#define G_HEADER(a)                      GETBITS(a,  8)
+#define G_RESERVEDH(a)                   GETBITS(a,  6)
 #define G_SIZE(a)                        GETBITS(a, 10)
-#define G_RTCM_MESSAGE_NUMBER(a)         GETBITS(a, 12)          /* DF002 */
-#define G_GPS_SATELLITE_ID(a)            GETBITS(a, 6)           /* DF068 */
-#define G_QZSS_SATELLITE_ID(a)           GETBITS(a, 4)           /* DF249 */
-#define G_GLONASS_SATELLITE_ID(a)        GETBITS(a, 5)
-
-#define G_GPS_IODE(a)                    GETBITS(a, 8)           /* DF071 */
-#define G_GLONASS_IOD(a)                 GETBITS(a, 8)           /* DF237 */
+
+/* GNSS macros - Header part */
+#define G_RTCM_MESSAGE_NUMBER(a)         GETBITS(a, 12)         /* DF002 */
+#define G_GPS_EPOCH_TIME(a, b)           {unsigned int temp; GETBITS(temp, 20) \
+ if(b && a != temp) return GCOBR_TIMEMISMATCH; a = temp;}
+#define G_GLONASS_EPOCH_TIME(a, b)       {unsigned int temp; GETBITS(temp, 17) \
+ if(b && a != temp) return GCOBR_TIMEMISMATCH; a = temp;}
+#define G_EPOCH_TIME(a)                  GETBITS(a, 20)
+#define G_SSR_UPDATE_INTERVAL(a)         GETBITS(a,  4)
+#define G_MULTIPLE_MESSAGE_INDICATOR(a)  GETBITS(a,  1)
+#define G_SATELLITE_REFERENCE_DATUM(a)   GETBITS(a,  1)
+#define G_SSR_IOD(a)                     GETBITS(a,  4)
+#define G_SSR_PROVIDER_ID(a)             GETBITS(a, 16)
+#define G_SSR_SOLUTION_ID(a)             GETBITS(a,  4)
+#define G_NO_OF_SATELLITES(a)            GETBITS(a,  6)
+
+/* GNSS macros - Satellite specific part */
+#define G_GPS_SATELLITE_ID(a)            GETBITS(a,  6)           /* DF068 */
+#define G_QZSS_SATELLITE_ID(a)           GETBITS(a,  4)           /* DF249 */
+#define G_GLONASS_SATELLITE_ID(a)        GETBITS(a,  5)
+#define G_GPS_IODE(a)                    GETBITS(a,  8)           /* DF071 */
+#define G_GLONASS_IOD(a)                 GETBITS(a,  8)           /* DF237 */
 #define G_GALILEO_IOD(a)                 GETBITS(a, 10)          /* DF459 */
 #define G_SBAS_T0MOD(a)                  GETBITSFACTOR(a, 9, 16) /* DF468 */
 #define G_SBAS_IODCRC(a)                 GETBITS(a, 24)          /* DF469 */
 #define G_BDS_TOEMOD(a)                  GETBITSFACTOR(a, 10, 8) /* DF470 */
-#define G_BDS_IOD(a)                     GETBITS(a, 8)           /* DF471 */
-
-/* defined values */
+#define G_BDS_IOD(a)                     GETBITS(a,  8)           /* DF471 */
+
 #define G_DELTA_RADIAL(a)                GETFLOATSIGN(a, 22, 1/10000.0)
 #define G_DELTA_ALONG_TRACK(a)           GETFLOATSIGN(a, 20, 1/2500.0)
@@ -715,8 +730,9 @@
 #define G_DELTA_DOT_CROSS_TRACK(a)       GETFLOATSIGN(a, 19, 1/250000.0)
 
-#define G_SATELLITE_REFERENCE_DATUM(a)   GETBITS(a, 1)
 #define G_DELTA_CLOCK_C0(a)              GETFLOATSIGN(a, 22, 1/10000.0)
 #define G_DELTA_CLOCK_C1(a)              GETFLOATSIGN(a, 21, 1/1000000.0)
 #define G_DELTA_CLOCK_C2(a)              GETFLOATSIGN(a, 27, 1/50000000.0)
+#define G_HR_CLOCK_CORRECTION(a)         GETFLOATSIGN(a, 22, 1/10000.0)
+
 #define G_NO_OF_CODE_BIASES(a)           GETBITS(a, 5)
 #define G_NO_OF_PHASE_BIASES(a)          GETBITS(a, 5)
@@ -724,14 +740,8 @@
 #define G_CODE_BIAS(a)                   GETFLOATSIGN(a, 14, 1/100.0)
 #define G_YAW_ANGLE(a)                   GETFLOAT(a, 9, MPI/256.0)
-#define G_YAW_RATE(a)                    GETFLOATSIGN(a, 8, MPI/8192.0)
+#define G_YAW_RATE(a)                    GETFLOATSIGN(a,  8, MPI/8192.0)
 #define G_PHASE_BIAS(a)                  GETFLOATSIGN(a, 20, 1/10000.0)
 
-#define G_GPS_EPOCH_TIME(a, b)           {unsigned int temp; GETBITS(temp, 20) \
- if(b && a != temp) return GCOBR_TIMEMISMATCH; a = temp;}
-#define G_GLONASS_EPOCH_TIME(a, b)       {unsigned int temp; GETBITS(temp, 17) \
- if(b && a != temp) return GCOBR_TIMEMISMATCH; a = temp;}
-#define G_EPOCH_TIME(a)                  GETBITS(a, 20)
-#define G_NO_OF_SATELLITES(a)            GETBITS(a, 6)
-#define G_MULTIPLE_MESSAGE_INDICATOR(a)  GETBITS(a, 1)
+/* Phase specific part of GNSS phase bias message */
 #define G_DISPERSIVE_BIAS_INDICATOR(a)   GETBITS(a, 1)
 #define G_MW_CONSISTENCY_INDICATOR(a)    GETBITS(a, 1)
@@ -739,19 +749,16 @@
 #define G_WIDE_LANE_INDICATOR(a)         GETBITS(a, 2)
 #define G_DISCONTINUITY_COUNTER(a)       GETBITS(a, 4)
+
+/* URA */
 #define G_SSR_URA(a)                     {int temp; GETBITS(temp, 6) \
  (a) = URAToValue(temp);}
-#define G_HR_CLOCK_CORRECTION(a)         GETFLOATSIGN(a, 22, 1/10000.0)
-#define G_SSR_UPDATE_INTERVAL(a)         GETBITS(a, 4)
-
-#define G_SSR_IOD(a)                     GETBITS(a, 4)
-#define G_SSR_PROVIDER_ID(a)             GETBITS(a, 16)
-#define G_SSR_SOLUTION_ID(a)             GETBITS(a, 4)
-
-#define G_NO_IONO_LAYERS(a)              {unsigned int temp; GETBITS(temp, 2) a = temp+1; }
-#define G_VTEC_QUALITY_INDICATOR(a)      GETFLOAT(a, 9,      1/20.0)
+
+/* Ionosphere */
+#define G_NO_IONO_LAYERS(a) {unsigned int temp; GETBITS(temp, 2) a = temp+1; }
+#define G_IONO_HEIGHT(a)                 GETFLOAT(a, 8 ,    10000.0)
+#define G_IONO_DEGREE(a)    {unsigned int temp; GETBITS(temp, 4) a = temp+1; }
+#define G_IONO_ORDER(a)     {unsigned int temp; GETBITS(temp, 4) a = temp+1; }
 #define G_IONO_COEFF(a)                  GETFLOATSIGN(a, 16,1/200.0)
-#define G_IONO_DEGREE(a)                 {unsigned int temp; GETBITS(temp, 4) a = temp+1; }
-#define G_IONO_ORDER(a)                  {unsigned int temp; GETBITS(temp, 4) a = temp+1; }
-#define G_IONO_HEIGHT(a)                 GETFLOAT(a, 8 ,    10000.0)
+#define G_VTEC_QUALITY_INDICATOR(a)      GETFLOAT    (a,  9,      1/20.0)
 
 enum GCOB_RETURN GetSSR(struct ClockOrbit *co, struct CodeBias *b,struct VTEC *v,
