~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/bindings/javahl/native/EnumMapper.cpp

  • Committer: Package Import Robot
  • Author(s): James McCoy, Peter Samuelson, James McCoy
  • Date: 2014-01-12 19:48:33 UTC
  • mfrom: (0.2.10)
  • Revision ID: package-import@ubuntu.com-20140112194833-w3axfwksn296jn5x
Tags: 1.8.5-1
[ Peter Samuelson ]
* New upstream release.  (Closes: #725787) Rediff patches:
  - Remove apr-abi1 (applied upstream), rename apr-abi2 to apr-abi
  - Remove loosen-sqlite-version-check (shouldn't be needed)
  - Remove java-osgi-metadata (applied upstream)
  - svnmucc prompts for a changelog if none is provided. (Closes: #507430)
  - Remove fix-bdb-version-detection, upstream uses "apu-config --dbm-libs"
  - Remove ruby-test-wc (applied upstream)
  - Fix “svn diff -r N file” when file has svn:mime-type set.
    (Closes: #734163)
  - Support specifying an encoding for mod_dav_svn's environment in which
    hooks are run.  (Closes: #601544)
  - Fix ordering of “svnadmin dump” paths with certain APR versions.
    (Closes: #687291)
  - Provide a better error message when authentication fails with an
    svn+ssh:// URL.  (Closes: #273874)
  - Updated Polish translations.  (Closes: #690815)

[ James McCoy ]
* Remove all traces of libneon, replaced by libserf.
* patches/sqlite_3.8.x_workaround: Upstream fix for wc-queries-test test
  failurse.
* Run configure with --with-apache-libexecdir, which allows removing part of
  patches/rpath.
* Re-enable auth-test as upstream has fixed the problem of picking up
  libraries from the environment rather than the build tree.
  (Closes: #654172)
* Point LD_LIBRARY_PATH at the built auth libraries when running the svn
  command during the build.  (Closes: #678224)
* Add a NEWS entry describing how to configure mod_dav_svn to understand
  UTF-8.  (Closes: #566148)
* Remove ancient transitional package, libsvn-ruby.
* Enable compatibility with Sqlite3 versions back to Wheezy.
* Enable hardening flags.  (Closes: #734918)
* patches/build-fixes: Enable verbose build logs.
* Build against the default ruby version.  (Closes: #722393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
jobject EnumMapper::mapNotifyState(svn_wc_notify_state_t state)
82
82
{
83
83
  // We're assuming a valid value for the C enum above
84
 
  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$Status", (int) state);
 
84
  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$Status",
 
85
                 static_cast<int>(state));
85
86
}
86
87
 
87
88
/**
90
91
jobject EnumMapper::mapNotifyAction(svn_wc_notify_action_t action)
91
92
{
92
93
  // We're assuming a valid value for the C enum above
93
 
  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$Action", (int) action);
 
94
  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$Action",
 
95
                 static_cast<int>(action));
94
96
}
95
97
 
96
98
jobject EnumMapper::mapReposNotifyNodeAction(svn_node_action action)
97
99
{
98
100
  // We're assuming a valid value for the C enum above
99
 
  return mapEnum(JAVA_PACKAGE"/ReposNotifyInformation$NodeAction", (int) action);
 
101
  return mapEnum(JAVA_PACKAGE"/ReposNotifyInformation$NodeAction",
 
102
                 static_cast<int>(action));
100
103
}
101
104
 
102
105
/**
105
108
jobject EnumMapper::mapReposNotifyAction(svn_repos_notify_action_t action)
106
109
{
107
110
  // We're assuming a valid value for the C enum above
108
 
  return mapEnum(JAVA_PACKAGE"/ReposNotifyInformation$Action", (int) action);
 
111
  return mapEnum(JAVA_PACKAGE"/ReposNotifyInformation$Action",
 
112
                 static_cast<int>(action));
109
113
}
110
114
 
111
115
/**
114
118
jobject EnumMapper::mapNodeKind(svn_node_kind_t nodeKind)
115
119
{
116
120
  // We're assuming a valid value for the C enum above
117
 
  return mapEnum(JAVA_PACKAGE"/types/NodeKind", (int) nodeKind);
 
121
  return mapEnum(JAVA_PACKAGE"/types/NodeKind",
 
122
                 static_cast<int>(nodeKind));
118
123
}
119
124
 
120
125
/**
123
128
jobject EnumMapper::mapNotifyLockState(svn_wc_notify_lock_state_t state)
124
129
{
125
130
  // We're assuming a valid value for the C enum above
126
 
  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$LockStatus", (int) state);
 
131
  return mapEnum(JAVA_PACKAGE"/ClientNotifyInformation$LockStatus",
 
132
                 static_cast<int>(state));
127
133
}
128
134
 
129
135
/**
132
138
jobject EnumMapper::mapScheduleKind(svn_wc_schedule_t schedule)
133
139
{
134
140
  // We're assuming a valid value for the C enum above
135
 
  return mapEnum(JAVA_PACKAGE"/types/Info$ScheduleKind", (int) schedule);
 
141
  return mapEnum(JAVA_PACKAGE"/types/Info$ScheduleKind",
 
142
                 static_cast<int>(schedule));
136
143
}
137
144
 
138
145
/**
142
149
{
143
150
  // We're assuming a valid value for the C enum above
144
151
  // The offset here is +1
145
 
  return mapEnum(JAVA_PACKAGE"/types/Status$Kind", ((int) svnKind) - 1);
 
152
  return mapEnum(JAVA_PACKAGE"/types/Status$Kind",
 
153
                 static_cast<int>(svnKind) - 1);
146
154
}
147
155
 
148
156
jobject EnumMapper::mapChecksumKind(svn_checksum_kind_t kind)
149
157
{
150
158
  // We're assuming a valid value for the C enum above
151
 
  return mapEnum(JAVA_PACKAGE"/types/Checksum$Kind", (int) kind);
 
159
  return mapEnum(JAVA_PACKAGE"/types/Checksum$Kind",
 
160
                 static_cast<int>(kind));
152
161
}
153
162
 
154
163
jobject EnumMapper::mapConflictKind(svn_wc_conflict_kind_t kind)
155
164
{
156
165
  // We're assuming a valid value for the C enum above
157
 
  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Kind", (int) kind);
 
166
  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Kind",
 
167
                 static_cast<int>(kind));
158
168
}
159
169
 
160
170
jobject EnumMapper::mapConflictAction(svn_wc_conflict_action_t action)
161
171
{
162
172
  // We're assuming a valid value for the C enum above
163
 
  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Action", (int) action);
 
173
  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Action",
 
174
                 static_cast<int>(action));
164
175
}
165
176
 
166
177
jobject EnumMapper::mapConflictReason(svn_wc_conflict_reason_t reason)
167
178
{
168
179
  // We're assuming a valid value for the C enum above
169
 
  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Reason", (int) reason);
 
180
  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Reason",
 
181
                 static_cast<int>(reason));
170
182
}
171
183
 
172
184
int EnumMapper::toMergeinfoLogKind(jobject jLogKind)
182
194
svn_depth_t EnumMapper::toDepth(jobject jdepth)
183
195
{
184
196
  // The offset for depths is -2
185
 
  return (svn_depth_t) (getOrdinal(JAVA_PACKAGE"/types/Depth", jdepth) - 2);
 
197
  return static_cast<svn_depth_t>(getOrdinal(JAVA_PACKAGE"/types/Depth", jdepth) - 2);
186
198
}
187
199
 
188
200
jobject EnumMapper::mapDepth(svn_depth_t depth)
189
201
{
190
202
  // We're assuming a valid value for the C enum above
191
203
  // The offset for depths is -2
192
 
  return mapEnum(JAVA_PACKAGE"/types/Depth", ((int) depth) + 2);
 
204
  return mapEnum(JAVA_PACKAGE"/types/Depth", static_cast<int>(depth) + 2);
193
205
}
194
206
 
195
207
jobject EnumMapper::mapOperation(svn_wc_operation_t operation)
196
208
{
197
209
  // We're assuming a valid value for the C enum above
198
 
  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Operation", (int) operation);
 
210
  return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Operation",
 
211
                 static_cast<int>(operation));
199
212
}
200
213
 
201
214
jobject EnumMapper::mapTristate(svn_tristate_t tristate)
202
215
{
203
216
  // We're assuming a valid value for the C enum above
204
217
  return mapEnum(JAVA_PACKAGE"/types/Tristate",
205
 
                 (int) (tristate - svn_tristate_false));
 
218
                 static_cast<int>(tristate - svn_tristate_false));
206
219
}
207
220
 
208
221
svn_wc_conflict_choice_t EnumMapper::toConflictChoice(jobject jchoice)
209
222
{
210
 
  return (svn_wc_conflict_choice_t) getOrdinal(
211
 
                        JAVA_PACKAGE"/ConflictResult$Choice", jchoice);
 
223
  return static_cast<svn_wc_conflict_choice_t>
 
224
             (getOrdinal(JAVA_PACKAGE"/ConflictResult$Choice", jchoice));
212
225
}
213
226
 
214
227
svn_opt_revision_kind EnumMapper::toRevisionKind(jobject jkind)
215
228
{
216
 
  return (svn_opt_revision_kind) getOrdinal(JAVA_PACKAGE"/types/Revision$Kind",
217
 
                                            jkind);
 
229
  return static_cast<svn_opt_revision_kind>
 
230
             (getOrdinal(JAVA_PACKAGE"/types/Revision$Kind", jkind));
218
231
}
219
232
 
220
233
jobject EnumMapper::mapSummarizeKind(svn_client_diff_summarize_kind_t sKind)
221
234
{
222
235
  // We're assuming a valid value for the C enum above
223
 
  return mapEnum(JAVA_PACKAGE"/DiffSummary$DiffKind", (int) sKind);
 
236
  return mapEnum(JAVA_PACKAGE"/DiffSummary$DiffKind",
 
237
                 static_cast<int>(sKind));
224
238
}
225
239
 
226
240
jobject EnumMapper::mapEnum(const char *clazzName, int index)
282
296
    POP_AND_RETURN(-1);
283
297
 
284
298
  env->PopLocalFrame(NULL);
285
 
  return (int) jorder;
 
299
  return static_cast<int>(jorder);
286
300
}