svn rev #23431: trunk/src/include/ 
    raeburn@MIT.EDU 
    raeburn at MIT.EDU
       
    Wed Dec  2 18:09:29 EST 2009
    
    
  
http://src.mit.edu/fisheye/changelog/krb5/?cs=23431
Commit By: raeburn
Log Message:
Add store_{16,32,64}_n functions, for potentially-unaligned, native-order values.
Changed Files:
U   trunk/src/include/k5-platform.h
Modified: trunk/src/include/k5-platform.h
===================================================================
--- trunk/src/include/k5-platform.h	2009-12-02 22:37:16 UTC (rev 23430)
+++ trunk/src/include/k5-platform.h	2009-12-02 23:09:29 UTC (rev 23431)
@@ -713,6 +713,35 @@
 #endif
 }
 
+static inline void
+store_16_n (unsigned int val, void *vp)
+{
+#ifdef _WIN32
+    unsigned __int16 n;
+#else
+    uint16_t n;
+#endif
+    n = val;
+    memcpy(vp, &n, 2);
+}
+static inline void
+store_32_n (unsigned int val, void *vp)
+{
+#ifdef _WIN32
+    unsigned __int32 n;
+#else
+    uint32_t n;
+#endif
+    n = val;
+    memcpy(vp, &n, 4);
+}
+static inline void
+store_64_n (UINT64_TYPE val, void *vp)
+{
+    UINT64_TYPE n;
+    n = val;
+    memcpy(vp, &n, 8);
+}
 static inline unsigned short
 load_16_n (const void *p)
 {
    
    
More information about the cvs-krb5
mailing list