зеркало из https://github.com/mozilla/pjs.git
Fix Irix bustage. Remove Windows linefeeds from file.
This commit is contained in:
Родитель
94e63e54f2
Коммит
790df497bc
|
@ -695,12 +695,12 @@ nsGlobalHistory::nsGlobalHistory()
|
|||
mAutocompleteOnlyTyped(PR_FALSE),
|
||||
mBatchesInProgress(0),
|
||||
mNowValid(PR_FALSE),
|
||||
mDirty(PR_FALSE),
|
||||
mAutoCompleteLearner(nsnull),
|
||||
mACFeatures(nsnull),
|
||||
mURLDataFile(nsnull),
|
||||
mEnv(nsnull),
|
||||
mStore(nsnull),
|
||||
mDirty(PR_FALSE),
|
||||
mAutoCompleteLearner(nsnull),
|
||||
mACFeatures(nsnull),
|
||||
mURLDataFile(nsnull),
|
||||
mEnv(nsnull),
|
||||
mStore(nsnull),
|
||||
mTable(nsnull)
|
||||
{
|
||||
LL_I2L(mFileSizeOnDisk, 0);
|
||||
|
@ -768,13 +768,13 @@ nsGlobalHistory::~nsGlobalHistory()
|
|||
}
|
||||
|
||||
if (mAutoCompleteLearner) {
|
||||
delete mAutoCompleteLearner;
|
||||
mAutoCompleteLearner = nsnull;
|
||||
delete mAutoCompleteLearner;
|
||||
mAutoCompleteLearner = nsnull;
|
||||
}
|
||||
|
||||
if (mACFeatures) {
|
||||
delete [] mACFeatures;
|
||||
mACFeatures = nsnull;
|
||||
delete [] mACFeatures;
|
||||
mACFeatures = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -936,7 +936,7 @@ nsGlobalHistory::AddExistingPageToDatabase(nsIMdbRow *row,
|
|||
SetRowValue(row, kToken_LastVisitDateColumn, aDate);
|
||||
SetRowValue(row, kToken_VisitCountColumn, (*aOldCount) + 1);
|
||||
|
||||
if (mLearningMode > AUTOCOMPLETE_NO_LEARNING ||
|
||||
if (mLearningMode > AUTOCOMPLETE_NO_LEARNING ||
|
||||
mDataCaptureMode > URLDATACAPTURE_NONE) {
|
||||
// Update the two Frequency-Recency metrics
|
||||
PRFloat64 m;
|
||||
|
@ -1005,7 +1005,7 @@ nsGlobalHistory::AddNewPageToDatabase(const char *aURL,
|
|||
SetRowValue(row, kToken_LastVisitDateColumn, aDate);
|
||||
SetRowValue(row, kToken_FirstVisitDateColumn, aDate);
|
||||
|
||||
if (mLearningMode > AUTOCOMPLETE_NO_LEARNING ||
|
||||
if (mLearningMode > AUTOCOMPLETE_NO_LEARNING ||
|
||||
mDataCaptureMode > URLDATACAPTURE_NONE) {
|
||||
// Initialize the Frequency-Recency metrics
|
||||
SetRowValue(row, kToken_FRFastDecayColumn, (PRFloat64) 1.0);
|
||||
|
@ -1552,14 +1552,14 @@ nsGlobalHistory::HidePage(const char *aURL)
|
|||
|
||||
if (!id) {
|
||||
AssignUniqueURLID(row, &id);
|
||||
}
|
||||
}
|
||||
|
||||
PRInt64ToChars(id, IDStr);
|
||||
fprintf(mURLDataFile, "<hide-url id='%s' time='%s'", IDStr.get(), dateStr.get());
|
||||
|
||||
if (mDataCaptureMode == URLDATACAPTURE_WITH_URL_INFO) {
|
||||
fprintf(mURLDataFile, " path='%s'", aURL);
|
||||
}
|
||||
fprintf(mURLDataFile, " path='%s'", aURL);
|
||||
}
|
||||
|
||||
fprintf(mURLDataFile, "/>\n");
|
||||
fflush(mURLDataFile);
|
||||
|
@ -2723,15 +2723,15 @@ nsGlobalHistory::Init()
|
|||
PRInt64ToChars(PR_Now(), dateStr);
|
||||
fprintf(mURLDataFile, "\n<startup time='%s'/>\n", dateStr.get());
|
||||
fflush(mURLDataFile);
|
||||
}
|
||||
else {
|
||||
mDataCaptureMode = URLDATACAPTURE_NONE;
|
||||
mURLDataFile = nsnull;
|
||||
}
|
||||
else {
|
||||
mDataCaptureMode = URLDATACAPTURE_NONE;
|
||||
mURLDataFile = nsnull;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Disable data capture
|
||||
mDataCaptureMode = URLDATACAPTURE_NONE;
|
||||
mDataCaptureMode = URLDATACAPTURE_NONE;
|
||||
mURLDataFile = nsnull;
|
||||
}
|
||||
}
|
||||
|
@ -2739,23 +2739,23 @@ nsGlobalHistory::Init()
|
|||
mURLDataFile = nsnull;
|
||||
}
|
||||
|
||||
if (mLearningMode > AUTOCOMPLETE_NO_LEARNING ||
|
||||
mDataCaptureMode > URLDATACAPTURE_NONE) {
|
||||
// Create perceptron and feature array.
|
||||
mAutoCompleteLearner = new nsSigmoidPerceptron(AC_NUM_URL_FEATURES);
|
||||
if (mAutoCompleteLearner) {
|
||||
mACFeatures = new PRFloat64[AC_NUM_URL_FEATURES];
|
||||
if (!mACFeatures) {
|
||||
delete mAutoCompleteLearner;
|
||||
mAutoCompleteLearner = nsnull;
|
||||
mLearningMode = AUTOCOMPLETE_NO_LEARNING;
|
||||
}
|
||||
}
|
||||
else {
|
||||
mLearningMode = AUTOCOMPLETE_NO_LEARNING;
|
||||
if (mLearningMode > AUTOCOMPLETE_NO_LEARNING ||
|
||||
mDataCaptureMode > URLDATACAPTURE_NONE) {
|
||||
// Create perceptron and feature array.
|
||||
mAutoCompleteLearner = new nsSigmoidPerceptron(AC_NUM_URL_FEATURES);
|
||||
if (mAutoCompleteLearner) {
|
||||
mACFeatures = new PRFloat64[AC_NUM_URL_FEATURES];
|
||||
if (!mACFeatures) {
|
||||
delete mAutoCompleteLearner;
|
||||
mAutoCompleteLearner = nsnull;
|
||||
mLearningMode = AUTOCOMPLETE_NO_LEARNING;
|
||||
}
|
||||
}
|
||||
else {
|
||||
mLearningMode = AUTOCOMPLETE_NO_LEARNING;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
mAutoCompleteLearner = nsnull;
|
||||
mACFeatures = nsnull;
|
||||
}
|
||||
|
@ -3330,7 +3330,7 @@ nsGlobalHistory::FindRow(mdb_column aCol,
|
|||
aCol, &yarn,
|
||||
&rowId, getter_AddRefs(row));
|
||||
|
||||
if (err) return NS_ERROR_FAILURE;
|
||||
if (err) return NS_ERROR_FAILURE;
|
||||
|
||||
if (!row) return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
|
@ -4652,12 +4652,12 @@ nsGlobalHistory::FillInputFeatures(nsAString &aUrl,
|
|||
PRInt64 addDate;
|
||||
nsCOMPtr<nsIRDFResource> rdfRes;
|
||||
|
||||
if (NS_SUCCEEDED(rv = gRDFService->GetResource(curl.get(),
|
||||
if (NS_SUCCEEDED(rv = gRDFService->GetResource(curl.get(),
|
||||
getter_AddRefs(rdfRes)))) {
|
||||
nsCOMPtr<nsIRDFDataSource> bookmarkDS = do_QueryInterface(bs, &rv);
|
||||
if (NS_SUCCEEDED(rv) && bookmarkDS) {
|
||||
nsCOMPtr<nsIRDFNode> nodeType;
|
||||
rv = bookmarkDS->GetTarget(rdfRes, kRDF_Type, PR_TRUE,
|
||||
rv = bookmarkDS->GetTarget(rdfRes, kRDF_Type, PR_TRUE,
|
||||
getter_AddRefs(nodeType));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (nodeType == kNC_Bookmark) {
|
||||
|
@ -4969,7 +4969,7 @@ nsGlobalHistory::OnAutoComplete(const PRUnichar *searchString,
|
|||
PRUint32 i;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (mLearningMode == AUTOCOMPLETE_NO_LEARNING &&
|
||||
if (mLearningMode == AUTOCOMPLETE_NO_LEARNING &&
|
||||
mDataCaptureMode == URLDATACAPTURE_NONE)
|
||||
return rv;
|
||||
|
||||
|
@ -5010,8 +5010,8 @@ nsGlobalHistory::OnAutoComplete(const PRUnichar *searchString,
|
|||
fprintf(mURLDataFile, "<autocomplete time='%s'", nowStr.get());
|
||||
|
||||
if (mDataCaptureMode == URLDATACAPTURE_WITH_URL_INFO) {
|
||||
fprintf(mURLDataFile, " url='%s'",
|
||||
NS_ConvertUCS2toUTF8(searchString).get());
|
||||
fprintf(mURLDataFile, " url='%s'",
|
||||
NS_ConvertUCS2toUTF8(searchString).get());
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(FindRowAndID(kToken_URLColumn,
|
||||
|
@ -5034,7 +5034,7 @@ nsGlobalHistory::OnAutoComplete(const PRUnichar *searchString,
|
|||
|
||||
rv = FillInputFeatures(value, mACFeatures);
|
||||
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
mDataCaptureMode >= URLDATACAPTURE_WITHOUT_URL_INFO) {
|
||||
WriteURLData(value, mACFeatures);
|
||||
}
|
||||
|
@ -5350,7 +5350,7 @@ nsGlobalHistory::AutoCompleteSortComparison(const void *v1, const void *v2,
|
|||
|
||||
rv = closure->history->FillInputFeatures(url1, &features[0]);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
closure->history->mAutoCompleteLearner->Test(features,
|
||||
closure->history->mAutoCompleteLearner->Test(features,
|
||||
AC_NUM_URL_FEATURES, &output);
|
||||
if (output >= 0.9)
|
||||
PrefixItemWithAsterisk(item1);
|
||||
|
@ -5358,7 +5358,7 @@ nsGlobalHistory::AutoCompleteSortComparison(const void *v1, const void *v2,
|
|||
|
||||
rv = closure->history->FillInputFeatures(url2, &features[0]);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
closure->history->mAutoCompleteLearner->Test(features,
|
||||
closure->history->mAutoCompleteLearner->Test(features,
|
||||
AC_NUM_URL_FEATURES, &output);
|
||||
if (output >= 0.9)
|
||||
PrefixItemWithAsterisk(item2);
|
||||
|
|
Загрузка…
Ссылка в новой задаче