~ubuntu-branches/ubuntu/trusty/virtualbox-ose/trusty

« back to all changes in this revision

Viewing changes to src/VBox/Runtime/common/rand/randadv.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
*   Header Files                                                               *
34
34
*******************************************************************************/
35
35
#include <iprt/rand.h>
 
36
#include "internal/iprt.h"
 
37
 
36
38
#include <iprt/mem.h>
37
39
#include <iprt/err.h>
38
40
#include <iprt/assert.h>
52
54
    /* forward the call */
53
55
    return pThis->pfnDestroy(pThis);
54
56
}
 
57
RT_EXPORT_SYMBOL(RTRandAdvDestroy);
55
58
 
56
59
 
57
60
RTDECL(int) RTRandAdvSeed(RTRAND hRand, uint64_t u64Seed) RT_NO_THROW
64
67
    /* forward the call */
65
68
    return pThis->pfnSeed(pThis, u64Seed);
66
69
}
 
70
RT_EXPORT_SYMBOL(RTRandAdvSeed);
67
71
 
68
72
 
69
73
RTDECL(int) RTRandAdvSaveState(RTRAND hRand, char *pszState, size_t *pcbState) RT_NO_THROW
78
82
    /* forward the call */
79
83
    return pThis->pfnSaveState(pThis, pszState, pcbState);
80
84
}
 
85
RT_EXPORT_SYMBOL(RTRandAdvSaveState);
81
86
 
82
87
 
83
88
RTDECL(int) RTRandAdvRestoreState(RTRAND hRand, char const *pszState) RT_NO_THROW
91
96
    /* forward the call */
92
97
    return pThis->pfnRestoreState(pThis, pszState);
93
98
}
 
99
RT_EXPORT_SYMBOL(RTRandAdvRestoreState);
94
100
 
95
101
 
96
102
RTDECL(void) RTRandAdvBytes(RTRAND hRand, void *pv, size_t cb) RT_NO_THROW
104
110
    /* forward the call */
105
111
    return pThis->pfnGetBytes(pThis, (uint8_t *)pv, cb);
106
112
}
 
113
RT_EXPORT_SYMBOL(RTRandAdvBytes);
107
114
 
108
115
 
109
116
RTDECL(int32_t) RTRandAdvS32Ex(RTRAND hRand, int32_t i32First, int32_t i32Last) RT_NO_THROW
116
123
    /* wrap the call */
117
124
    return pThis->pfnGetU32(pThis, 0, i32Last - i32First) + i32First;
118
125
}
 
126
RT_EXPORT_SYMBOL(RTRandAdvS32Ex);
119
127
 
120
128
 
121
129
RTDECL(int32_t) RTRandAdvS32(RTRAND hRand) RT_NO_THROW
128
136
    /* wrap the call */
129
137
    return pThis->pfnGetU32(pThis, 0, UINT32_MAX) + INT32_MAX;
130
138
}
 
139
RT_EXPORT_SYMBOL(RTRandAdvS32);
131
140
 
132
141
 
133
142
RTDECL(uint32_t) RTRandAdvU32Ex(RTRAND hRand, uint32_t u32First, uint32_t u32Last) RT_NO_THROW
140
149
    /* forward the call */
141
150
    return pThis->pfnGetU32(pThis, u32First, u32Last);
142
151
}
 
152
RT_EXPORT_SYMBOL(RTRandAdvU32Ex);
143
153
 
144
154
 
145
155
RTDECL(uint32_t) RTRandAdvU32(RTRAND hRand) RT_NO_THROW
152
162
    /* forward the call */
153
163
    return pThis->pfnGetU32(pThis, 0, UINT32_MAX);
154
164
}
 
165
RT_EXPORT_SYMBOL(RTRandAdvU32);
155
166
 
156
167
 
157
168
RTDECL(int64_t) RTRandAdvS64Ex(RTRAND hRand, int64_t i64First, int64_t i64Last) RT_NO_THROW
164
175
    /* wrap the call */
165
176
    return pThis->pfnGetU64(pThis, 0, i64Last - i64First) + i64First;
166
177
}
 
178
RT_EXPORT_SYMBOL(RTRandAdvS64Ex);
167
179
 
168
180
 
169
181
RTDECL(int64_t) RTRandAdvS64(RTRAND hRand) RT_NO_THROW
176
188
    /* wrap the call */
177
189
    return pThis->pfnGetU64(pThis, 0, UINT64_MAX) + INT64_MAX;
178
190
}
 
191
RT_EXPORT_SYMBOL(RTRandAdvS64);
179
192
 
180
193
 
181
194
RTDECL(uint64_t) RTRandAdvU64Ex(RTRAND hRand, uint64_t u64First, uint64_t u64Last) RT_NO_THROW
188
201
    /* forward the call */
189
202
    return pThis->pfnGetU64(pThis, u64First, u64Last);
190
203
}
 
204
RT_EXPORT_SYMBOL(RTRandAdvU64Ex);
191
205
 
192
206
 
193
207
RTDECL(uint64_t) RTRandAdvU64(RTRAND hRand) RT_NO_THROW
200
214
    /* forward the call */
201
215
    return pThis->pfnGetU64(pThis, 0, UINT64_MAX);
202
216
}
 
217
RT_EXPORT_SYMBOL(RTRandAdvU64);
203
218
 
204
219
 
205
220
DECLCALLBACK(void)  rtRandAdvSynthesizeBytesFromU32(PRTRANDINT pThis, uint8_t *pb, size_t cb)
401
416
    return VINF_SUCCESS;
402
417
}
403
418
 
404