Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
a27cb623
Commit
a27cb623
authored
13 years ago
by
Tadashi G. Takaoka
Committed by
Android (Google) Code Review
13 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Use C++ template for min/max"
parents
3f8fc4de
09baa36f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
native/src/correction.cpp
+1
-0
1 addition, 0 deletions
native/src/correction.cpp
native/src/defines.h
+2
-2
2 additions, 2 deletions
native/src/defines.h
native/src/words_priority_queue.h
+3
-1
3 additions, 1 deletion
native/src/words_priority_queue.h
with
6 additions
and
3 deletions
native/src/correction.cpp
+
1
−
0
View file @
a27cb623
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include
"char_utils.h"
#include
"char_utils.h"
#include
"correction.h"
#include
"correction.h"
#include
"defines.h"
#include
"dictionary.h"
#include
"dictionary.h"
#include
"proximity_info.h"
#include
"proximity_info.h"
...
...
This diff is collapsed.
Click to expand it.
native/src/defines.h
+
2
−
2
View file @
a27cb623
...
@@ -241,8 +241,8 @@ static void prof_out(void) {
...
@@ -241,8 +241,8 @@ static void prof_out(void) {
#define MIN_USER_TYPED_LENGTH_FOR_MULTIPLE_WORD_SUGGESTION 3
#define MIN_USER_TYPED_LENGTH_FOR_MULTIPLE_WORD_SUGGESTION 3
#define MIN_USER_TYPED_LENGTH_FOR_EXCESSIVE_CHARACTER_SUGGESTION 3
#define MIN_USER_TYPED_LENGTH_FOR_EXCESSIVE_CHARACTER_SUGGESTION 3
#def
ine min(
a,b) ((a)<(b)?(a):(b))
template
<
typename
T
>
inl
ine
T
min
(
T
a
,
T
b
)
{
return
a
<
b
?
a
:
b
;
}
#def
ine max(
a,b) ((a)>(b)?(a):(b))
template
<
typename
T
>
inl
ine
T
max
(
T
a
,
T
b
)
{
return
a
>
b
?
a
:
b
;
}
// The ratio of neutral area radius to sweet spot radius.
// The ratio of neutral area radius to sweet spot radius.
#define NEUTRAL_AREA_RADIUS_RATIO 1.3f
#define NEUTRAL_AREA_RADIUS_RATIO 1.3f
...
...
This diff is collapsed.
Click to expand it.
native/src/words_priority_queue.h
+
3
−
1
View file @
a27cb623
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#ifndef LATINIME_WORDS_PRIORITY_QUEUE_H
#ifndef LATINIME_WORDS_PRIORITY_QUEUE_H
#define LATINIME_WORDS_PRIORITY_QUEUE_H
#define LATINIME_WORDS_PRIORITY_QUEUE_H
#include
<cstring>
// for memcpy()
#include
<iostream>
#include
<iostream>
#include
<queue>
#include
<queue>
#include
"defines.h"
#include
"defines.h"
...
@@ -93,7 +94,8 @@ class WordsPriorityQueue {
...
@@ -93,7 +94,8 @@ class WordsPriorityQueue {
int
outputSuggestions
(
int
*
frequencies
,
unsigned
short
*
outputChars
)
{
int
outputSuggestions
(
int
*
frequencies
,
unsigned
short
*
outputChars
)
{
mHighestSuggestedWord
=
0
;
mHighestSuggestedWord
=
0
;
const
unsigned
int
size
=
min
(
MAX_WORDS
,
mSuggestions
.
size
());
const
unsigned
int
size
=
min
(
MAX_WORDS
,
static_cast
<
unsigned
int
>
(
mSuggestions
.
size
()));
int
index
=
size
-
1
;
int
index
=
size
-
1
;
while
(
!
mSuggestions
.
empty
()
&&
index
>=
0
)
{
while
(
!
mSuggestions
.
empty
()
&&
index
>=
0
)
{
SuggestedWord
*
sw
=
mSuggestions
.
top
();
SuggestedWord
*
sw
=
mSuggestions
.
top
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment